Skip to content

Commit afe5334

Browse files
authored
fix(fortran) Fixed FORTRAN 77 style comments (#2689)
1 parent cda973c commit afe5334

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

Diff for: CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ Language Improvements:
88
- enh(java) Add support for `record` (#2685) [Josh Goebel][]
99
- fix(csharp) prevent modifier keywords wrongly flagged as `title` (#2683) [Josh Goebel][]
1010
- enh(axapta) Update keyword list for Axapta (X++) (#2686) [Ryan Jonasson][]
11+
- fix(fortran) FORTRAN 77-style comments (#2677) [Philipp Engel][]
1112

1213
[David Pine]: https://github.com/IEvangelist
1314
[Josh Goebel]: https://github.com/yyyc514
1415
[Ryan Jonasson]: https://github.com/ryanjonasson
16+
[Philipp Engel]: https://github.com/interkosmos
1517
[Konrad Rudolph]: https://github.com/klmr
1618

1719
## Version 10.2.0

Diff for: src/languages/fortran.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ export default function(hljs) {
1414
const COMMENT = {
1515
variants: [
1616
hljs.COMMENT('!', '$', {relevance: 0}),
17-
// allow Fortran 77 style comments
18-
hljs.COMMENT('^C', '$', {relevance: 0})
17+
// allow FORTRAN 77 style comments
18+
hljs.COMMENT('^C[ ]', '$', {relevance: 0}),
19+
hljs.COMMENT('^C$', '$', {relevance: 0})
1920
]
2021
};
2122

Diff for: test/markup/fortran/comments.expect.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<span class="hljs-comment">C</span>
2-
<span class="hljs-comment">C This program in FORTRAN 77 outputs &quot;Hello, World!&quot;.</span>
3-
<span class="hljs-comment">C ====================================================</span>
4-
51
<span class="hljs-comment">!===============================</span>
62
<span class="hljs-comment">! This is a test subroutine</span>
73
<span class="hljs-comment">!===============================</span>
@@ -11,3 +7,5 @@
117
C=<span class="hljs-number">2</span>
128
C = <span class="hljs-number">2</span> <span class="hljs-comment">!correct</span>
139
C =<span class="hljs-string">&#x27;boo&#x27;</span>
10+
11+
<span class="hljs-keyword">contains</span>

Diff for: test/markup/fortran/comments.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
C
2-
C This program in FORTRAN 77 outputs "Hello, World!".
3-
C ====================================================
4-
51
!===============================
62
! This is a test subroutine
73
!===============================
@@ -11,3 +7,5 @@ C ====================================================
117
C=2
128
C = 2 !correct
139
C ='boo'
10+
11+
contains

0 commit comments

Comments
 (0)