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

Some operator are not highlighted #8

Open
DanielSiepmann opened this issue Oct 14, 2018 · 1 comment
Open

Some operator are not highlighted #8

DanielSiepmann opened this issue Oct 14, 2018 · 1 comment

Comments

@DanielSiepmann
Copy link
Contributor

TypoScript provides the following operator which are not highlighted yet: :=, >.

https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/TypoScriptSyntax/Syntax/TypoScriptSyntax.html

Also one might highlight special keywords used in combination with :=: https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/TypoScriptSyntax/Syntax/TypoScriptSyntax.html#value-modifications-the-operator

DanielSiepmann added a commit to DanielSiepmann/mirror-vim.typoscript that referenced this issue Oct 14, 2018
DanielSiepmann added a commit to DanielSiepmann/mirror-vim.typoscript that referenced this issue Oct 14, 2018
DanielSiepmann added a commit to DanielSiepmann/mirror-vim.typoscript that referenced this issue Oct 14, 2018
Add := and > as tsLineOperator.

Relates elmar-hinz#8
@elmar-hinz
Copy link
Owner

elmar-hinz commented Oct 15, 2018

Hello Daniel,

thank you very much for the pull request. I test it and try to follow the improvements.

Let's review the Object unsetting sign ">" first. You say it is not highlighted. I find the entry:

syntax match tsLineOperator "\v\>\s*$" contained containedin=tsSingleline

This should match it and classify it as tsLineOperator, which is mapped to the vim Operator highlighting class.

highlight link tsLineOperator Operator

This regular expression above assumes, that it is not followed by other text within the same line. It would not be matched, if you place a comment within the same line.

The expression says:

  1. use \v very magic regular expressions (similar to perl regular expressions).
  2. match the ">" sign
  3. allow whitespace or none
  4. then the end of line

I am a little out of exercise with typoscript. Maybe you like to provide a small file with all examples, that should be highlighted. As a common test case. Does not need to be real TS, just a concentrate of all features.

I suggest the path:

vim.typoscript/example.ts

As a separate pull request, I could merge it first.

DanielSiepmann added a commit to DanielSiepmann/mirror-vim.typoscript that referenced this issue Mar 23, 2022
DanielSiepmann added a commit to DanielSiepmann/mirror-vim.typoscript that referenced this issue Mar 23, 2022
Add := and > as tsLineOperator.

Relates elmar-hinz#8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants