mirror of
https://github.com/buggins/dlangide.git
synced 2025-05-03 00:19:53 +03:00
libdparser
This commit is contained in:
parent
b526afa7aa
commit
008e7e742f
2 changed files with 176 additions and 33 deletions
|
@ -1,20 +1,29 @@
|
|||
void main() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Computes average line length for standard input.
|
||||
import std.stdio;
|
||||
//changed
|
||||
void main()
|
||||
{
|
||||
ulong lines = 0;
|
||||
double sumLength = 0;
|
||||
foreach (line; stdin.byLine())
|
||||
{
|
||||
++lines;
|
||||
sumLength += line.length;
|
||||
class foo(T) {
|
||||
private:
|
||||
static if (1) {
|
||||
int n() {
|
||||
T b;
|
||||
return 25;
|
||||
}
|
||||
}
|
||||
writeln("Average line length: ",
|
||||
lines ? sumLength / lines : 0);
|
||||
string n;
|
||||
}
|
||||
|
||||
struct bar(X: foo) {
|
||||
int n() { return 13; }
|
||||
debug long n;
|
||||
void func(T)(T param) {
|
||||
T a = param;
|
||||
}
|
||||
}
|
||||
|
||||
void main(string[] args)
|
||||
{
|
||||
int n;
|
||||
foo fooinst = new foo();
|
||||
n = 19 + foo.n;
|
||||
args[0] = "asd";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue