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

enh(twig): update keywords list #3415

Merged
merged 6 commits into from Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -2,6 +2,7 @@

Grammars:

- enh(twig) update keywords list
joshgoebel marked this conversation as resolved.
Show resolved Hide resolved
- fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][]
- fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][]
- enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][]
Expand Down
12 changes: 6 additions & 6 deletions src/languages/twig.js
Expand Up @@ -13,7 +13,7 @@ export default function(hljs) {
begin: '\\(', end: '\\)'
};

var FUNCTION_NAMES = 'attribute block constant cycle date dump include ' +
var FUNCTION_NAMES = 'attribute block constant country_timezones cycle date dump html_classes include ' +
'max min parent random range source template_from_string';

var FUNCTIONS = {
Expand All @@ -28,16 +28,16 @@ export default function(hljs) {
var FILTER = {
begin: /\|[A-Za-z_]+:?/,
keywords:
'abs batch capitalize column convert_encoding date date_modify default ' +
'escape filter first format inky_to_html inline_css join json_encode keys last ' +
'length lower map markdown merge nl2br number_format raw reduce replace ' +
'reverse round slice sort spaceless split striptags title trim upper url_encode',
'abs batch capitalize column convert_encoding country_name currency_name currency_symbol data_uri date date_modify default ' +
'escape filter first format format_currency format_date format_datetime format_number format_time html_to_markdown inky_to_html inline_css join json_encode keys language_name last ' +
'length locale_name lower map markdown markdown_to_html merge nl2br number_format raw reduce replace ' +
'reverse round slice slug sort spaceless split striptags timezone_name title u|0 trim upper url_encode',
contains: [
FUNCTIONS
]
};

var TAGS = 'apply autoescape block deprecated do embed extends filter flush for from ' +
var TAGS = 'apply autoescape block cache deprecated do embed extends filter flush for from ' +
'if import include macro sandbox set use verbatim with';

TAGS = TAGS + ' ' + TAGS.split(' ').map(function(t){return 'end' + t}).join(' ');
Expand Down