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

Hugo Syntax Mishandling PreProcessor Directives #34

Closed
1 task done
tajmone opened this issue Nov 13, 2019 · 0 comments
Closed
1 task done

Hugo Syntax Mishandling PreProcessor Directives #34

tajmone opened this issue Nov 13, 2019 · 0 comments
Labels
🔨 Highlight Tool: Highlight (syntax highlighter) ⭐ syntax highlighting Topic: Syntax Highlighting ⚠️ important Priority: High
Milestone

Comments

@tajmone
Copy link
Owner

tajmone commented Nov 13, 2019

  • Fix Hugo syntax handling of preprocessor directives.

Currently, the Highlight syntax is set to capture any token starting with # as a preprocessor directive (up to the end of the line).

This interferes with the use of # token used to find out the number of properties, as in:

<object>.#<property>

An example of how this disrupts highlighting can be found in §10.2. Characters:

print capital object.pronoun; " opened "; object.pronoun #3; " box. "

Where from #3; onward the rest of the line is treated as preprocessor directive, and " box. " as a preprocessor string.

This can be fixed by using a dummy keyword group to capture all preprocessor directives by RegEx pattern, and then use OnStateChange() function to enforce them as preprocessor directive. Doing so, it will allow to also define # as an operator.

@tajmone tajmone added ⚠️ important Priority: High ⭐ syntax highlighting Topic: Syntax Highlighting 🔨 Highlight Tool: Highlight (syntax highlighter) labels Nov 13, 2019
@tajmone tajmone added this to the hugo code milestone Nov 13, 2019
@tajmone tajmone pinned this issue Nov 13, 2019
tajmone added a commit that referenced this issue Nov 13, 2019
* `Hugo.lang` v1.1.0-rc10:

Prevent Highlighting the `#` used to count properties as if it was the
beginning of a PrePreprocessor directive. (Fixes #34)
@tajmone tajmone closed this as completed Nov 13, 2019
@tajmone tajmone unpinned this issue Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 Highlight Tool: Highlight (syntax highlighter) ⭐ syntax highlighting Topic: Syntax Highlighting ⚠️ important Priority: High
Projects
None yet
Development

No branches or pull requests

1 participant