mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
1872c668a5
Change requested by Manoj. CHANGELOG_BEGIN CHANGELOG_END
26 lines
721 B
Python
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
|
|
]
|
|
}
|
|
|
|
|
|
|