daml/docs/configs/static/pygments_daml_lexer.py
Gary Verhaegen 1872c668a5
replace DAML Authors with DA in copyright headers (#5228)
Change requested by Manoj.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-27 01:26:10 +01:00

26 lines
721 B
Python

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from pygments.lexers.haskell import HaskellLexer
from pygments.lexer import inherit
from pygments.token import *
class DAMLLexer(HaskellLexer):
name = 'DAML'
aliases = ['daml']
filenames = ['*.daml']
daml_reserved = ('template', 'with', 'controller', 'can', 'ensure', 'daml', 'observer', 'signatory', 'agreement', 'controller', 'nonconsuming', 'return', 'this')
tokens = {
'root': [
(r'\b(%s)(?!\')\b' % '|'.join(daml_reserved), Keyword.Reserved),
(r'\b(True|False)\b', Keyword.Constant),
inherit
]
}