# -*- coding: UTF-8 -*-
# Syntax definition automatically generated by hljs2xt.py
# source: handlebars.js
name = 'Handlebars'
file_patterns = ['*.handlebars', '*.hbs', '*.html.hbs', '*.html.handlebars']

flags = re.IGNORECASE | re.MULTILINE

class comment:
    default_text_color = DELIMITER
    rules = [
        # ignore {'begin': {'pattern': "\\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\\b", 'type': 'RegExp'}},
        ('doctag', [RE(r"(?:TODO|FIXME|NOTE|BUG|XXX):")]),
    ]

builtin_name = """
    each in with if else unless bindattr action collection debugger log
    outlet template unbound view yield
    """.split()

class name0:
    default_text_color = DELIMITER
    rules = [('builtin-name', builtin_name)]
name0.__name__ = 'name'

class name2:
    default_text_color = DELIMITER
    rules = [
        ('builtin-name', builtin_name),
        ('name', RE(r"[a-zA-Z\.-]+"), [RE(r"\B|\b")], name0),
    ]
name2.__name__ = 'name'

class string:
    default_text_color = DELIMITER
    rules = [('operator.escape', [RE(r"\\[\s\S]")])]

class _group1:
    default_text_color = DELIMITER
    ends_with_parent = True
    rules = [('string', RE(r"\""), [RE(r"\"")], string)]

class template_tag:
    default_text_color = DELIMITER
    rules = [('name', name2, [RE(r"(?=\}\})")], _group1)]
template_tag.__name__ = 'template-tag'

class template_variable:
    default_text_color = DELIMITER
    rules = [('builtin-name', builtin_name)]
template_variable.__name__ = 'template-variable'

rules = [
    ('comment', RE(r"{{!(?:--)?"), [RE(r"(?:--)?}}")], comment),
    ('template-tag', RE(r"\{\{[#\/]"), [RE(r"\}\}")], template_tag),
    ('template-variable', RE(r"\{\{"), [RE(r"\}\}")], template_variable),
]
