Skip to content
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

The "@longcode" tag makes incorrect code display. #123

Open
opensimply opened this issue Mar 13, 2021 · 4 comments
Open

The "@longcode" tag makes incorrect code display. #123

opensimply opened this issue Mar 13, 2021 · 4 comments

Comments

@opensimply
Copy link

opensimply commented Mar 13, 2021

There are two issues with @longcode tag.

  1. Bold for the identifier after the qualifier in the dot notation, if the identifier is called "Name".
  2. Various coloring of numbers when explicitly specifying this color in an external style file., like span.pascal_numeric {color: blue;}

longcode.zip

@michaliskambi
Copy link
Collaborator

michaliskambi commented Jul 26, 2021

AD 1 - Indeed. The Name is detected as a standard directive, as in procedure Foo; external name 'Foo2'; .

I didn't fix it yet (we could hardcode a condition that "identifier after dot is never a standard directive", but it would need to be checked whether it doesn't make any regressions).

AD 2 - Floating-point values have style pascal_float. So use something like

span.pascal_numeric, span.pascal_float { color: blue; }

to more reliably color all numbers.

Moreover, our @longCode scanning code didn't recognize numbers in the scientific notation. I fixed that now (fixed in 8075a29 , acb26a4 , testcase added in 5c9a9b3 ).

So this is half-fixed now.

Zrzut ekranu z 2021-07-26 02-43-49

@opensimply
Copy link
Author

Thank you. Should I close this ticket?

@michaliskambi
Copy link
Collaborator

Let's leave it open for now. I'd like to fix Name highlighting (I suspect other Pascal standard directives are similarly affected) at some point, it just needs time to test. I would introduce similar logic for @longcode and our PasDoc_Tokenizer ("identifier after the dot should not be treated as a standard directive") and see does it cause any regressions on pasdoc testcases and Castle Game Engine. If not, it would be probably OK solution.

@opensimply
Copy link
Author

Good luck with your coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants