New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue in highlighting fortran code: kind of intrinsic data type #1723
Comments
Solution This is the solution to the above question.
|
Is there any chance to be merged in the new revision of main release? |
@kookma Could you make a PR out of this (plus some tests)? |
Sure, but I don't know how to make a PR? Should I fork this repo? |
Yes, first fork the repo and commit changes to it. Then in your repo on "Pull requests" tab find "New pull request" button. |
@egor-rogov |
@egor-rogov |
See also #1566 |
@yyyc514
And it seems you solution from #1566 works! So, I think you can to close this issue. |
Well, our desire is the highlight the WHOLE number, including the "kind", that's why this is still open. What should be fixed now if us "losing" the first digit, which was not good at all. |
What I checked at https://jsfiddle.net/ajoshguy/nagkqytv/11/ is
and it shows the whole number including the first number and the kind highlighted! I am afraid I don't understand what you explained. |
I see it as below, so it works at https://jsfiddle.net/ajoshguy/nagkqytv/11/ |
Not Fortran. :-) Did you tell it to load fortran in the init config? |
Where is that? I just used |
No it loads only the common set. It's at the top of the file. It's meant to be as close as possible to an actual usage, so it would be a poor testing environment if it loaded EVERYTHING. |
@yyyc514 okay, I changed the first like to In my revised version as I explained above I use
and it works fine. Have a look at Here I use highlight.js as plugin! Scroll down to see the modified highlight.js |
You can edit online the content and check Fortran code of your own! |
Yeah, we've been debating on the correct/best match rule. That might wait till .12 though, depends how much time I have between now and release. My priority was first fixing the data loss. |
Okay! Thank you for all your efforts. |
…r detection (#2379) * enh(fortran) support intrinsic data types Closes #1723. * (parser) throw "0 width match" error for bad regex Closes #2140. - In safe mode 0 width matches will be safely and quietly ignored and advance the cursor 1 step, as before. - In debug mode a "0 width match" error will be thrown. This should help prevent such misbehaved rules from sneaking back into the library in the future.
…r detection (highlightjs#2379) * enh(fortran) support intrinsic data types Closes highlightjs#1723. * (parser) throw "0 width match" error for bad regex Closes highlightjs#2140. - In safe mode 0 width matches will be safely and quietly ignored and advance the cursor 1 step, as before. - In debug mode a "0 width match" error will be thrown. This should help prevent such misbehaved rules from sneaking back into the library in the future.
@yyyc514 still there! |
The full fix should be in 10.0. Pretty sure we closed this one down. Please test on the 10.0 beta. |
many thanks Josh! |
In modern fortran you can set the kind of intrinsic data type. It means you can define additional intrinsic data type. When you do so, for literal constants you have to use the kind name attached to literal consonant using under score.
Example
Highlight.js issue
When using highlight.js to highlight a Fortran code contains such named constant, highlight.js fails to do the job! It highlights the remaining code (from the position of named constant) in a wrong way!
Note
12_ps
)The text was updated successfully, but these errors were encountered: