Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/fortran-fixed.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd"> | 2 | <!DOCTYPE language SYSTEM "language.dtd"> | ||
3 | <language name="Fortran (Fixed Format)" version="4" kateversion="5.0" section="Sources" extensions="*.f;*.F;*.for;*.FOR;*.fpp;*.FPP;" mimetype="text/x-fortran-src" casesensitive="0" author="Franchin Matteo (fnch@libero.it)" license="LGPL" priority="9"> | 3 | <language name="Fortran (Fixed Format)" version="5" kateversion="5.0" section="Sources" extensions="*.f;*.F;*.for;*.FOR;*.fpp;*.FPP;" mimetype="text/x-fortran-src" casesensitive="0" author="Franchin Matteo (fnch@libero.it)" license="LGPL" priority="9"> | ||
4 | <!-- by Franchin Matteo, fnch@libero.it --> | 4 | <!-- by Franchin Matteo, fnch@libero.it --> | ||
5 | <!-- NOTE: Keep in sync with the "Fortran (Free Format)" highlighter! (fortran-free.xml) --> | 5 | <!-- NOTE: Keep in sync with the "Fortran (Free Format)" highlighter! (fortran-free.xml) --> | ||
6 | <highlighting> | 6 | <highlighting> | ||
7 | 7 | | |||
8 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | 8 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
9 | <!-- * L I S T S * --> | 9 | <!-- * L I S T S * --> | ||
10 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | 10 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
11 | <list name="keywords"> | 11 | <list name="keywords"> | ||
▲ Show 20 Lines • Show All 348 Lines • ▼ Show 20 Line(s) | 358 | <!-- Random numbers --> | |||
360 | <item>random_seed</item> | 360 | <item>random_seed</item> | ||
361 | </list> | 361 | </list> | ||
362 | 362 | | |||
363 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | 363 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
364 | <!-- * C O N T E X T S * --> | 364 | <!-- * C O N T E X T S * --> | ||
365 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | 365 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
366 | <contexts> | 366 | <contexts> | ||
367 | <context attribute="Normal Text" lineEndContext="#stay" name="default" > | 367 | <context attribute="Normal Text" lineEndContext="#stay" name="default" > | ||
368 | <IncludeRules context="find_preprocessor" /> | ||||
369 | <IncludeRules context="find_comments" /> | ||||
368 | <IncludeRules context="find_strings" /> | 370 | <IncludeRules context="find_strings" /> | ||
nibags: I recommend moving lines 374 and 375 (`<IncludeRules context="find_preprocessor" />` and… | |||||
369 | <IncludeRules context="find_decls" /> | 371 | <IncludeRules context="find_decls" /> | ||
370 | <IncludeRules context="find_intrinsics" /> | 372 | <IncludeRules context="find_intrinsics" /> | ||
371 | <IncludeRules context="find_io_stmnts" /> | 373 | <IncludeRules context="find_io_stmnts" /> | ||
372 | <IncludeRules context="find_op_and_log" /> | 374 | <IncludeRules context="find_op_and_log" /> | ||
373 | <IncludeRules context="find_numbers" /> | 375 | <IncludeRules context="find_numbers" /> | ||
374 | <IncludeRules context="find_preprocessor" /> | 376 | <IncludeRules context="find_continue" /> | ||
375 | <IncludeRules context="find_comments" /> | | |||
376 | <IncludeRules context="find_symbols" /> | 377 | <IncludeRules context="find_symbols" /> | ||
377 | <IncludeRules context="find_begin_stmnts" /> | 378 | <IncludeRules context="find_begin_stmnts" /> | ||
378 | <IncludeRules context="find_end_stmnts" /> | 379 | <IncludeRules context="find_end_stmnts" /> | ||
379 | <IncludeRules context="find_mid_stmnts" /> | 380 | <IncludeRules context="find_mid_stmnts" /> | ||
380 | </context> | 381 | </context> | ||
381 | <!--************************END OF THE MAIN CONTEXT*************************--> | 382 | <!--************************END OF THE MAIN CONTEXT*************************--> | ||
382 | 383 | | |||
383 | 384 | | |||
Show All 17 Lines | 396 | <context attribute="Normal Text" lineEndContext="#stay" name="find_op_and_log"> | |||
401 | <Detect2Chars attribute="Operator" context="#stay" char="<" char1="="/> | 402 | <Detect2Chars attribute="Operator" context="#stay" char="<" char1="="/> | ||
402 | <Detect2Chars attribute="Operator" context="#stay" char=">" char1="="/> | 403 | <Detect2Chars attribute="Operator" context="#stay" char=">" char1="="/> | ||
403 | <AnyChar attribute="Operator" context="#stay" String="<>"/> | 404 | <AnyChar attribute="Operator" context="#stay" String="<>"/> | ||
404 | </context> | 405 | </context> | ||
405 | 406 | | |||
406 | <!-- This context highlights comments --> | 407 | <!-- This context highlights comments --> | ||
407 | <context attribute="Normal Text" lineEndContext="#stay" name="find_comments"> | 408 | <context attribute="Normal Text" lineEndContext="#stay" name="find_comments"> | ||
408 | <AnyChar attribute="Comment" context="comment" String="cC*" column="0"/> | 409 | <AnyChar attribute="Comment" context="comment" String="cC*" column="0"/> | ||
410 | <DetectChar attribute="Comment" context="comment" char="!"/> | ||||
411 | <RegExpr attribute="Comment" context="comment" String="." column="72" /> | ||||
Here put String="." instead of ".*", because this also highlights alerts in the comment line (for example: TODO, NOTE, ALERT). nibags: Here put `String="."` instead of `".*"`, because this also highlights alerts in the comment… | |||||
409 | </context> | 412 | </context> | ||
410 | 413 | | |||
411 | <context attribute="Comment" lineEndContext="#pop" name="comment"> | 414 | <context attribute="Comment" lineEndContext="#pop" name="comment"> | ||
412 | <IncludeRules context="##Alerts"/> | 415 | <IncludeRules context="##Alerts"/> | ||
413 | <IncludeRules context="##Modelines"/> | 416 | <IncludeRules context="##Modelines"/> | ||
414 | </context> | 417 | </context> | ||
415 | 418 | | |||
416 | <!-- This context highlights symbols --> | 419 | <!-- This context highlights symbols --> | ||
417 | <context attribute="Normal Text" lineEndContext="#stay" name="find_symbols"> | 420 | <context attribute="Normal Text" lineEndContext="#stay" name="find_symbols"> | ||
418 | <Detect2Chars attribute="Keyword" context="#stay" char="*" char1="*"/> | 421 | <Detect2Chars attribute="Keyword" context="#stay" char="*" char1="*"/> | ||
419 | <Detect2Chars attribute="Keyword" context="#stay" char="(" char1="/"/> | 422 | <Detect2Chars attribute="Keyword" context="#stay" char="(" char1="/"/> | ||
420 | <Detect2Chars attribute="Keyword" context="#stay" char="/" char1=")"/> | 423 | <Detect2Chars attribute="Keyword" context="#stay" char="/" char1=")"/> | ||
421 | <AnyChar attribute="Keyword" context="#stay" String="&+-*/=?[]^{|}~"/> | 424 | <AnyChar attribute="Keyword" context="#stay" String="&+-*/=?[]^{|}~"/> | ||
422 | <AnyChar attribute="Symbol" context="#stay" String="(),"/> | 425 | <AnyChar attribute="Symbol" context="#stay" String="(),"/> | ||
423 | </context> | 426 | </context> | ||
424 | 427 | | |||
428 | <!-- This context highlights the continuation character --> | ||||
429 | <context attribute="Normal Text" lineEndContext="#stay" name="find_continue"> | ||||
430 | <RegExpr attribute="Continuation character" context="#stay" String="^ [^0-9\s]"/> | ||||
431 | </context> | ||||
432 | | ||||
425 | <!-- This context highlights items inside the parentesis of a function --> | 433 | <!-- This context highlights items inside the parentesis of a function --> | ||
426 | <context attribute="Normal Text" lineEndContext="#stay" name="inside_func_paren"> | 434 | <context attribute="Normal Text" lineEndContext="#stay" name="inside_func_paren"> | ||
427 | <DetectChar attribute="Normal Text" context="inside_func_paren" char="("/> | 435 | <DetectChar attribute="Normal Text" context="inside_func_paren" char="("/> | ||
428 | <DetectChar attribute="Normal Text" context="#pop" char=")"/> | 436 | <DetectChar attribute="Normal Text" context="#pop" char=")"/> | ||
429 | <IncludeRules context="find_strings" /> | 437 | <IncludeRules context="find_strings" /> | ||
430 | <IncludeRules context="find_intrinsics" /> | 438 | <IncludeRules context="find_intrinsics" /> | ||
431 | <IncludeRules context="find_numbers" /> | 439 | <IncludeRules context="find_numbers" /> | ||
432 | </context> | 440 | </context> | ||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 547 | <context attribute="String" lineEndContext="#stay" name="string_2" fallthrough="true" fallthroughContext="#pop"> | |||
541 | <RegExpr attribute="Keyword" context="end_of_string" String="&\s*$"/> | 549 | <RegExpr attribute="Keyword" context="end_of_string" String="&\s*$"/> | ||
542 | <RegExpr attribute="String" context="end_of_string" String=".*(?=&\s*$)"/> | 550 | <RegExpr attribute="String" context="end_of_string" String=".*(?=&\s*$)"/> | ||
543 | </context> | 551 | </context> | ||
544 | 552 | | |||
545 | <context attribute="String" lineEndContext="#stay" name="end_of_string" fallthrough="true" fallthroughContext="#pop#pop"> | 553 | <context attribute="String" lineEndContext="#stay" name="end_of_string" fallthrough="true" fallthroughContext="#pop#pop"> | ||
546 | <DetectSpaces /> | 554 | <DetectSpaces /> | ||
547 | <RegExpr attribute="Keyword" context="#stay" String="&\s*$"/> | 555 | <RegExpr attribute="Keyword" context="#stay" String="&\s*$"/> | ||
548 | <DetectChar attribute="Keyword" context="#pop" char="&" firstNonSpace="true"/> | 556 | <DetectChar attribute="Keyword" context="#pop" char="&" firstNonSpace="true"/> | ||
549 | <AnyChar attribute="Comment" context="comment" String="cC*" column="0"/> | 557 | <AnyChar attribute="Comment" context="comment" String="cC*" column="0"/> | ||
558 | <DetectChar attribute="Comment" context="comment" char="!" firstNonSpace="true"/> | ||||
Here add the rule: <DetectChar attribute="Comment" context="comment" char="!" firstNonSpace="true"/> In the previous fortran.xml file it was like this. nibags: Here add the rule: `<DetectChar attribute="Comment" context="comment" char="!"… | |||||
550 | </context> | 559 | </context> | ||
551 | </contexts> | 560 | </contexts> | ||
552 | 561 | | |||
553 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | 562 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
554 | <!-- * S T Y L E I T E M D E F I N I T I O N S * --> | 563 | <!-- * S T Y L E I T E M D E F I N I T I O N S * --> | ||
555 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | 564 | <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
556 | <itemDatas> | 565 | <itemDatas> | ||
557 | <itemData name="Normal Text" defStyleNum="dsNormal"/> | 566 | <itemData name="Normal Text" defStyleNum="dsNormal"/> | ||
558 | <itemData name="Keyword" defStyleNum="dsKeyword"/> | 567 | <itemData name="Keyword" defStyleNum="dsKeyword"/> | ||
559 | <itemData name="Data Type" defStyleNum="dsDataType"/> | 568 | <itemData name="Data Type" defStyleNum="dsDataType"/> | ||
560 | <itemData name="Decimal" defStyleNum="dsDecVal"/> | 569 | <itemData name="Decimal" defStyleNum="dsDecVal"/> | ||
561 | <itemData name="Float" defStyleNum="dsFloat"/> | 570 | <itemData name="Float" defStyleNum="dsFloat"/> | ||
562 | <itemData name="String" defStyleNum="dsString"/> | 571 | <itemData name="String" defStyleNum="dsString"/> | ||
563 | <itemData name="Comment" defStyleNum="dsComment"/> | 572 | <itemData name="Comment" defStyleNum="dsComment"/> | ||
564 | <itemData name="Symbol" defStyleNum="dsNormal"/> | 573 | <itemData name="Symbol" defStyleNum="dsNormal"/> | ||
565 | <itemData name="Preprocessor" defStyleNum="dsOthers"/> | 574 | <itemData name="Preprocessor" defStyleNum="dsOthers"/> | ||
566 | <itemData name="Operator" defStyleNum="dsOperator" bold="1" italic="0"/> | 575 | <itemData name="Operator" defStyleNum="dsOperator" bold="1" italic="0"/> | ||
567 | <itemData name="Logical" defStyleNum="dsConstant" bold="1" italic="0"/> | 576 | <itemData name="Logical" defStyleNum="dsConstant" bold="1" italic="0"/> | ||
568 | <itemData name="IO Function" defStyleNum="dsFunction" bold="0" italic="0"/> | 577 | <itemData name="IO Function" defStyleNum="dsFunction" bold="0" italic="0"/> | ||
569 | <itemData name="Elemental Procedure" defStyleNum="dsBuiltIn" bold="1" italic="0"/> | 578 | <itemData name="Elemental Procedure" defStyleNum="dsBuiltIn" bold="1" italic="0"/> | ||
579 | <itemData name="Continuation character" defStyleNum="dsBuiltIn" bold="1" italic="0"/> | ||||
570 | <itemData name="Inquiry Function" defStyleNum="dsFunction" bold="1" italic="1"/> | 580 | <itemData name="Inquiry Function" defStyleNum="dsFunction" bold="1" italic="1"/> | ||
571 | <itemData name="Transformational Function" defStyleNum="dsFunction" bold="1" italic="0"/> | 581 | <itemData name="Transformational Function" defStyleNum="dsFunction" bold="1" italic="0"/> | ||
572 | <itemData name="Non elemental subroutine" defStyleNum="dsFunction" bold="1" italic="0"/> | 582 | <itemData name="Non elemental subroutine" defStyleNum="dsFunction" bold="1" italic="0"/> | ||
573 | </itemDatas> | 583 | </itemDatas> | ||
574 | </highlighting> | 584 | </highlighting> | ||
575 | <general> | 585 | <general> | ||
576 | <comments> | 586 | <comments> | ||
577 | <comment name="singleLine" start="c"/> | 587 | <comment name="singleLine" start="c"/> | ||
578 | </comments> | 588 | </comments> | ||
579 | <keywords casesensitive="0"/> | 589 | <keywords casesensitive="0"/> | ||
580 | </general> | 590 | </general> | ||
581 | </language> | 591 | </language> | ||
582 | <!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> | 592 | <!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |
I recommend moving lines 374 and 375 (<IncludeRules context="find_preprocessor" /> and <IncludeRules context="find_comments" />) to the beginning of the "default" context so that they have higher priority. For example, when writing a number on column 72, it's not highlighted as a comment, because numbers have a higher priority.