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

varnish: support Fastly's dialect #1454

Merged
merged 9 commits into from Mar 8, 2020
Merged

varnish: support Fastly's dialect #1454

merged 9 commits into from Mar 8, 2020

Conversation

gfx
Copy link
Member

@gfx gfx commented Mar 7, 2020

Added Fasty's extension for Varnish configuration language (a.k.a. VCL). Fastly's VCL is proprietary, closed-source software but I think it is worth adding to the core because (1) the primary users are outside the company, and (2) some lexers have dialects of proprietary, closed-source software like Oracle for SQL.

This PR includes some bug fixes.

The complete reference of Fastly's VCL is here: https://docs.fastly.com/vcl/

test commands: bundle exec bin/rougify highlight -m text/x-vcl spec/visual/samples/vcl

@gfx gfx requested a review from pyrmont March 7, 2020 08:03
@pyrmont pyrmont self-assigned this Mar 7, 2020
@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Mar 7, 2020
@katef
Copy link

katef commented Mar 7, 2020

Thank you!

@gfx
Copy link
Member Author

gfx commented Mar 8, 2020

I have also renamed the language name from "Varnish" to "VCL" in 7886c6d

This is because the right name of the language is called "VCL", standing for "Varnish Configuration Language", whereas "Varnish" is the name of the HTTP server. However, the interface does not change, by keeping aliases and mime types.

lib/rouge/lexers/vcl.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@pyrmont pyrmont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have had more of a fuller review. Some additional questions:

lib/rouge/lexers/varnish.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/varnish.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/varnish.rb Outdated Show resolved Hide resolved
@pyrmont pyrmont added author-action The PR has been reviewed but action by the author is needed and removed needs-review The PR needs to be reviewed labels Mar 8, 2020
@gfx gfx requested a review from pyrmont March 8, 2020 14:37
@pyrmont pyrmont merged commit 13e502e into master Mar 8, 2020
@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label Mar 8, 2020
@gfx
Copy link
Member Author

gfx commented Mar 8, 2020

Thanks!

@gfx gfx deleted the varnish_fastly_dialect branch March 9, 2020 04:32
mattt pushed a commit to NSHipster/rouge that referenced this pull request May 21, 2020
This commit adds support for Fastly's extensions to the Varnish
configuration language (a.k.a. VCL). Fastly's VCL is proprietary,
closed-source software but because (1) the primary users are outside the
company, and (2) Rouge already includes some proprietary dialects in
other lexers, this was deemed to be acceptable.
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

Successfully merging this pull request may close these issues.

None yet

3 participants