/usr/share/codeblocks/lexers/lexer_d.sample is in codeblocks-common 13.12-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | /**
* This is a Ddoc block comment
* Authors: Melvin D. Nerd, melvin@mailinator.com
* Bugs: Doesn't work for negative values.
* Date: March 14, 2003
*/
module hello;
import std.stdio;
/**
* This is a documentation comment block
* @param xxx does this (this is the documentation keyword)
* @authr some user (this is the documentation keyword error)
*/
void main(string[] args)
{
/*
* Sample preview code
* This is a block comment
*/
/// Deprecated: superseded by function bar().
void foo() { }
int numbers[20];
int average = 0;
char ch = '\n';
int a = /+ Nested Comment +/ 1;
int b = 2; // Line Comment
writefln("Hello World, Reloaded");
// auto type inference and built-in foreach
foreach (argc, argv; args)
{
// Improved typesafe printf
writeln("argc: ", argc, " arg: ", argv);
}
// Nested structs and classes
struct specs
{
// all members automatically initialized
int count, allocated;
}
// Nested functions can refer to outer
// variables like args
specs argspecs()
{
specs* s = new specs;
// no need for '->'
s.count = args.length; // get length of array with .length
s.allocated = typeof(args).sizeof; // built-in native type properties
foreach (argv; args)
s.allocated += argv.length * typeof(argv[0]).sizeof;
return *s;
}
// built-in string and common string operations
writefln("argc = %d, " ~ "allocated = %d",
argspecs().count, argspecs().allocated);
}
|