Issue #752 resolved

Add support for Ceylon language

Anonymous created an issue


We've got a patch for adding support for Ceylon we'd like to send you, how can we do that?

I'll put it below in case that's good enough, I can't see how to attach a file here.



class CeylonLexer(RegexLexer): """ For Ceylon <>_ source code. """

name = 'Ceylon'
aliases = ['ceylon']
filenames = ['*.ceylon']
mimetypes = ['text/x-ceylon']

flags = re.MULTILINE | re.DOTALL

#: optional Comment or Whitespace
_ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'

tokens = {
    'root': [
        # method names
        (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
         r'([a-zA-Z_][a-zA-Z0-9_]*)'                    # method name
         r'(\s*)(\()',                                  # signature start
         bygroups(using(this), Name.Function, Text, Operator)),
        (r'[^\S\n]+', Text),
        (r'//.*?\n', Comment.Single),
        (r'/\*.*?\*/', Comment.Multiline),
        (r'(variable|shared|abstract|doc|by)', Name.Decorator),
         r'transient|volatile)\b', Keyword.Declaration),
        (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
        (r'(true|false|null)\b', Keyword.Constant),
        (r'(class|interface|object)(\s+)', bygroups(Keyword.Declaration, Text), 'class'),
        (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
        (r'"(\\\\|\\"|[^"])*"', String),
        (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Quoted),
        (r"`\\.`|`[^\\]`|`\\u[0-9a-f]{4}`", String.Char),
        (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
        (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
        (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
        (r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
        (r'\d{1,3}(_\d{3})+\.\d{1,3}(_\d{3})+[kMGPTmunpf]?', Number.Float),
        (r'\d{1,3}(_\d{3})+\.[0-9]+([eE][+-]?[0-9]+)?[kMGPTmunpf]?', Number.Float),
        (r'[0-9][0-9]*\.\d{1,3}(_\d{3})+[kMGPTmunpf]?', Number.Float),
        (r'[0-9][0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[kMGPTmunpf]?', Number.Float),
        (r'0x[0-9a-f]+', Number.Hex),
        (r'\d{1,3}(_\d{3})+[kMGPT]?', Number.Integer),
        (r'[0-9]+[kMGPT]?', Number.Integer),
        (r'\n', Text)
    'class': [
        (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
    'import': [
        (r'[a-zA-Z0-9_.]+\w+ \{([a-zA-Z,]+|\.\.\.)\}', Name.Namespace, '#pop')


Comments (10)

  1. Anonymous

    The island is a popular holiday spot for young people where bars stay open until dawn and binge drinking out of “buckets” <a href="">Jimmy Choo shoes</a> is said to be a popular pastime. Claude Rochon of the Department of Foreign Affairs media office in Ottawa refused to disclose any information other than to say, <a href="">Jimmy Choo Slingbacks</a> “our thoughts are with the family and friends of the Canadian citizens who passed away in Thailand.”

  2. Anonymous

    All through that summer the work of the farm went like clockwork. The animals were happy as they had http://www.officialjimmychoosales.comnever conceived it possible to be. Every mouthful of food was an acute positive pleasure, now that it was truly their own food, produced by themselves and for themselves, not doled out to them by a grudging master

  3. Anonymous

    With the worthless parasitical human beings gone, there was more for everyone to eat. There was more leisure too, inexperienced though the animals were. They met with many difficulties--for instance, later in " the year, when they harvested the corn, they had to tread it out in the ancient style and blow away the chaff with their breath, since the farm possessed no threshing machine--but the pigs with their cleverness and Boxer with his tremendous muscles always pulled them through

  4. Anonymous
  5. Anonymous
  6. Anonymous
  7. Log in to comment