Check-in [16abe21957]
Not logged in
Overview
SHA1 Hash:16abe219572ba217643f2e01bdb862714c548fea
Date: 2010-11-24 12:50:04
User: kinaba
Comment:added documentation comment to polemy.ast so that it also works for @macro users of Polemy.
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified main.d from [f44d615cc4428107] to [97a442948c980634].

10 10 import std.algorithm; 11 11 import std.array; 12 12 13 13 /// Advance args[] to point the argument list fed to the script. 14 14 /// Returns the name of the source file to run, or returns "" if 15 15 /// no filename was given. Also, returns to libs[] the list of 16 16 /// library source to load. 17 +/// TODO: use std.getopt 17 18 18 19 string parseArgv(ref string[] args, out string[] libs) 19 20 { 20 21 args.popFront(); 21 22 22 23 while( !args.empty && args.front=="-l" ) { 23 24 args.popFront();

Modified polemy/ast.d from [2e3f1e0044f7841f] to [55043f61f436485a].

8 8 import polemy._common; 9 9 import polemy.failure; 10 10 import polemy.layer; 11 11 12 12 /// 13 13 abstract class AST 14 14 { 15 - LexPosition pos; 15 + LexPosition pos; /// 16 16 17 17 mixin SimpleConstructor; 18 18 } 19 19 20 -/// 20 +/// AST node for integer literal 21 21 class Int : AST 22 22 { 23 - BigInt data; 23 + BigInt data; /// 24 24 25 25 mixin SimpleClass; 26 26 this(LexPosition pos, int n) {super(pos); data = n;} 27 27 this(LexPosition pos, long n) {super(pos); data = n;} 28 28 this(LexPosition pos, BigInt n) {super(pos); data = n;} 29 29 this(LexPosition pos, string n) {super(pos); data = BigInt(n);} 30 30 } 31 31 32 -/// 32 +/// AST node for string literal 33 33 class Str : AST 34 34 { 35 - string data; 35 + string data; /// 36 + 37 + mixin SimpleClass; 38 +} 39 + 40 +/// AST node for variable reference 41 +class Var : AST 42 +{ 43 + string name; /// 36 44 37 45 mixin SimpleClass; 38 46 } 39 47 40 -/// 41 -class Var : AST 48 +/// AST node for @layered(expression) 49 +class Lay : AST 42 50 { 43 - string name; 51 + Layer layer; /// 52 + AST expr; /// 44 53 45 54 mixin SimpleClass; 46 55 } 47 56 48 -/// 49 -class Lay : AST 57 +/// AST node for variable declaration 58 +class Let : AST 50 59 { 51 - Layer layer; 52 - AST expr; 60 + string name; /// 61 + Layer layer; /// 62 + AST init; /// 63 + AST expr; /// 53 64 54 65 mixin SimpleClass; 55 66 } 56 67 57 -/// 58 -class Let : AST 59 -{ 60 - string name; 61 - Layer layer; 62 - AST init; 63 - AST expr; 64 - 65 - mixin SimpleClass; 66 -} 67 - 68 -/// 68 +/// AST node for function application 69 69 class App : AST 70 70 { 71 - AST fun; 72 - AST[] args; 71 + AST fun; /// 72 + AST[] args; /// 73 73 74 74 mixin SimpleClass; 75 75 this(LexPosition pos, AST fun, AST[] args...) { super(pos); this.fun=fun; this.args=args.dup; } 76 76 } 77 77 78 78 /// 79 79 class Parameter 80 80 { 81 - string name; 82 - Layer[] layers; 81 + string name; /// 82 + Layer[] layers; /// 83 83 84 84 mixin SimpleClass; 85 85 } 86 86 87 -/// 87 +/// AST node for function literal 88 88 class Fun : AST 89 89 { 90 - Parameter[] params; 91 - AST funbody; 90 + Parameter[] params; /// 91 + AST funbody; /// 92 92 93 93 mixin SimpleClass; 94 94 } 95 95 96 96 /// List of AST Types 97 97 98 98 alias TypeTuple!(Int,Str,Var,Lay,Let,App,Fun) ListOfASTTypes;