Hex Artifact Content
Not logged in

Artifact 7d7a59abebf26f18a772cb20e295db6dc5dbcf21:


0000: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 20  -------------.  
0050: 50 6f 6c 65 6d 79 20 30 2e 31 2e 30 0a 20 20 20  Polemy 0.1.0.   
0060: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0070: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 79                by
0090: 20 6b 2e 69 6e 61 62 61 20 28 77 77 77 2e 6b 6d   k.inaba (www.km
00a0: 6f 6e 6f 73 2e 6e 65 74 29 0a 20 20 20 20 20 20  onos.net).      
00b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
00c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
00d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
00e0: 20 20 20 20 20 20 20 20 20 20 4e 6f 76 20 38 2c            Nov 8,
00f0: 20 32 30 31 30 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   2010.----------
0100: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0110: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0120: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0130: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0140: 2d 2d 2d 0a 0a 0a 0a 3c 3c 48 6f 77 20 74 6f 20  ---....<<How to 
0150: 42 75 69 6c 64 3e 3e 0a 0a 20 20 2d 20 49 6e 73  Build>>..  - Ins
0160: 74 61 6c 6c 20 44 4d 44 0a 20 20 20 20 20 20 68  tall DMD.      h
0170: 74 74 70 3a 2f 2f 77 77 77 2e 64 69 67 69 74 61  ttp://www.digita
0180: 6c 6d 61 72 73 2e 63 6f 6d 2f 64 2f 32 2e 30 2f  lmars.com/d/2.0/
0190: 63 68 61 6e 67 65 6c 6f 67 2e 68 74 6d 6c 0a 20  changelog.html. 
01a0: 20 20 20 56 65 72 73 69 6f 6e 20 32 2e 30 35 30     Version 2.050
01b0: 20 69 73 20 72 65 63 6f 6d 6d 65 6e 64 65 64 2e   is recommended.
01c0: 20 4f 6c 64 65 72 20 61 6e 64 2f 6f 72 20 6e 65   Older and/or ne
01d0: 77 65 72 20 76 65 72 73 69 6f 6e 20 6d 61 79 20  wer version may 
01e0: 6e 6f 74 20 77 6f 72 6b 2e 0a 0a 20 20 2d 20 42  not work...  - B
01f0: 75 69 6c 64 0a 20 20 20 20 20 20 28 66 6f 72 20  uild.      (for 
0200: 57 69 6e 64 6f 77 73 29 20 52 75 6e 20 62 75 69  Windows) Run bui
0210: 6c 64 2e 62 61 74 0a 20 20 20 20 20 20 28 66 6f  ld.bat.      (fo
0220: 72 20 55 6e 69 78 29 20 52 75 6e 20 62 75 69 6c  r Unix) Run buil
0230: 64 2e 73 68 0a 20 20 20 20 20 20 6f 72 20 75 73  d.sh.      or us
0240: 65 20 79 6f 75 72 20 66 61 76 6f 72 69 74 65 20  e your favorite 
0250: 62 75 69 6c 64 20 74 6f 6f 6c 73 20 75 70 6f 6e  build tools upon
0260: 20 6d 61 69 6e 2e 64 20 61 6e 64 20 70 6f 6c 65   main.d and pole
0270: 6d 79 2f 2a 2e 64 2e 0a 0a 20 20 54 68 65 6e 20  my/*.d...  Then 
0280: 79 6f 75 20 77 69 6c 6c 20 67 65 74 20 74 68 65  you will get the
0290: 20 65 78 65 63 75 74 61 62 6c 65 20 22 70 6f 6c   executable "pol
02a0: 65 6d 79 22 20 69 6e 20 74 68 65 20 22 62 69 6e  emy" in the "bin
02b0: 22 20 64 69 72 65 63 74 6f 72 79 2e 0a 0a 0a 0a  " directory.....
02c0: 3c 3c 4c 69 63 65 6e 73 65 3e 3e 0a 0a 20 20 64  <<License>>..  d
02d0: 32 73 74 61 63 6b 74 72 61 63 65 2f 2a 0a 0a 20  2stacktrace/*.. 
02e0: 20 20 20 69 73 20 77 72 69 74 74 65 6e 20 62 79     is written by
02f0: 20 42 65 6e 6a 61 6d 69 6e 20 54 68 61 75 74 20   Benjamin Thaut 
0300: 61 6e 64 20 6c 69 63 65 6e 73 65 64 20 75 6e 64  and licensed und
0310: 65 72 20 32 2d 63 6c 61 75 73 65 20 42 53 44 20  er 2-clause BSD 
0320: 4c 69 63 65 6e 73 65 2e 0a 20 20 20 20 53 65 65  License..    See
0330: 20 68 74 74 70 3a 2f 2f 33 64 2e 62 65 6e 6a 61   http://3d.benja
0340: 6d 69 6e 2d 74 68 61 75 74 2e 64 65 2f 3f 70 3d  min-thaut.de/?p=
0350: 31 35 20 66 6f 72 20 74 68 65 20 64 65 74 61 69  15 for the detai
0360: 6c 2e 0a 0a 20 20 20 20 28 74 68 69 73 20 70 61  l...    (this pa
0370: 63 6b 61 67 65 20 69 73 20 75 73 65 64 20 6f 6e  ckage is used on
0380: 6c 79 20 66 6f 72 20 65 6e 61 62 6c 69 6e 67 20  ly for enabling 
0390: 73 74 61 63 6b 2d 74 72 61 63 65 73 20 64 75 72  stack-traces dur
03a0: 69 6e 67 20 70 72 69 6e 74 69 6e 67 20 65 78 63  ing printing exc
03b0: 65 70 74 69 6f 6e 73 3b 0a 20 20 20 20 20 69 74  eptions;.     it
03c0: 20 69 73 20 6e 6f 74 20 75 73 65 64 20 66 6f 72   is not used for
03d0: 20 72 65 6c 65 61 73 65 20 62 75 69 6c 64 73 2e   release builds.
03e0: 29 0a 0a 20 20 70 6f 6c 65 6d 79 2f 2a 0a 20 20  )..  polemy/*.  
03f0: 6d 61 69 6e 2e 64 0a 0a 20 20 20 20 41 6c 6c 20  main.d..    All 
0400: 74 68 65 20 6f 74 68 65 72 20 70 61 72 74 73 20  the other parts 
0410: 61 72 65 20 77 72 69 74 74 65 6e 20 62 79 20 4b  are written by K
0420: 61 7a 75 68 69 72 6f 20 49 6e 61 62 61 20 61 6e  azuhiro Inaba an
0430: 64 0a 20 20 20 20 6c 69 63 65 6e 73 65 64 20 75  d.    licensed u
0440: 6e 64 65 72 20 4e 59 53 4c 20 30 2e 39 39 38 32  nder NYSL 0.9982
0450: 20 28 20 68 74 74 70 3a 2f 2f 77 77 77 2e 6b 6d   ( http://www.km
0460: 6f 6e 6f 73 2e 6e 65 74 2f 6e 79 73 6c 2f 20 29  onos.net/nysl/ )
0470: 2e 0a 0a 0a 0a 3c 3c 48 6f 77 20 74 6f 20 55 73  .....<<How to Us
0480: 65 3e 3e 0a 0a 20 20 3e 20 70 6f 6c 65 6d 79 0a  e>>..  > polemy.
0490: 20 20 20 20 20 20 73 74 61 72 74 73 20 52 45 50        starts REP
04a0: 4c 0a 0a 20 20 3e 20 70 6f 6c 65 6d 79 20 66 6f  L..  > polemy fo
04b0: 6f 2e 70 6d 79 0a 20 20 20 20 20 20 65 78 65 63  o.pmy.      exec
04c0: 75 74 65 73 20 66 6f 6f 2e 70 6d 79 0a 0a 0a 0a  utes foo.pmy....
04d0: 3c 3c 4d 65 6d 6f 20 6f 66 20 4c 61 6e 67 75 61  <<Memo of Langua
04e0: 67 65 20 53 70 65 63 3e 3e 0a 0a 73 79 6e 74 61  ge Spec>>..synta
04f0: 78 0a 0a 20 45 20 3a 3a 3d 20 28 22 76 61 72 22  x.. E ::= ("var"
0500: 7c 22 6c 65 74 22 7c 22 64 65 66 22 7c 4c 41 59  |"let"|"def"|LAY
0510: 45 52 29 20 49 44 20 22 3d 22 20 45 20 3b 20 45  ER) ID "=" E ; E
0520: 0a 20 20 20 20 20 7c 20 22 66 75 6e 22 20 22 28  .     | "fun" "(
0530: 22 20 50 41 52 41 4d 53 20 22 29 22 20 22 7b 22  " PARAMS ")" "{"
0540: 20 45 20 22 7d 22 0a 20 20 20 20 20 7c 20 45 20   E "}".     | E 
0550: 22 28 22 20 41 52 47 53 20 22 29 22 0a 0a 20 20  "(" ARGS ")"..  
0560: 20 20 20 7c 20 4c 41 59 45 52 20 22 28 22 20 45     | LAYER "(" E
0570: 20 22 29 22 0a 0a 20 20 20 20 20 7c 20 22 28 22   ")"..     | "("
0580: 20 45 20 22 29 22 0a 20 20 20 20 20 7c 20 45 20   E ")".     | E 
0590: 42 49 4e 4f 50 20 45 0a 20 20 20 20 20 7c 20 22  BINOP E.     | "
05a0: 69 66 22 20 22 28 22 20 45 20 22 29 22 20 22 7b  if" "(" E ")" "{
05b0: 22 20 45 20 22 7d 22 0a 20 20 20 20 20 7c 20 22  " E "}".     | "
05c0: 69 66 22 20 22 28 22 20 45 20 22 29 22 20 22 7b  if" "(" E ")" "{
05d0: 22 20 45 20 22 7d 22 20 22 65 6c 73 65 20 22 7b  " E "}" "else "{
05e0: 22 20 45 20 22 7d 22 0a 20 20 20 20 20 7c 20 28  " E "}".     | (
05f0: 22 76 61 72 22 7c 22 6c 65 74 22 7c 22 64 65 66  "var"|"let"|"def
0600: 22 7c 4c 41 59 45 52 29 20 49 44 20 22 28 22 20  "|LAYER) ID "(" 
0610: 50 41 52 41 4d 53 20 22 29 22 20 22 7b 22 20 45  PARAMS ")" "{" E
0620: 20 22 7d 22 0a 0a 41 52 47 53 20 3a 3a 3d 20 22   "}"..ARGS ::= "
0630: 2c 22 2d 73 65 70 61 72 61 74 65 64 20 45 27 73  ,"-separated E's
0640: 0a 50 41 52 41 4d 53 20 3a 3a 3d 20 22 2c 22 2d  .PARAMS ::= ","-
0650: 73 65 70 61 72 61 74 65 64 20 56 41 52 27 73 0a  separated VAR's.
0660: 4c 41 59 45 52 20 3a 3a 3d 20 22 40 22 20 49 44  LAYER ::= "@" ID
0670: 0a 0a 69 66 2d 74 68 65 6e 2d 65 6c 73 65 20 69  ..if-then-else i
0680: 73 20 61 20 73 79 6e 74 61 78 20 73 75 67 61 72  s a syntax sugar
0690: 20 66 6f 72 20 61 20 66 75 6e 63 74 69 6f 6e 20   for a function 
06a0: 63 61 6c 6c 3a 20 69 66 28 20 45 2c 20 66 75 6e  call: if( E, fun
06b0: 28 29 7b 45 7d 2c 20 66 75 6e 28 29 7b 45 7d 20  (){E}, fun(){E} 
06c0: 29 0a 62 69 6e 61 72 79 20 6f 70 73 20 28 65 2e  ).binary ops (e.
06d0: 67 2e 2c 20 45 20 2b 20 45 29 20 69 73 20 61 20  g., E + E) is a 
06e0: 73 79 6e 74 61 78 20 73 75 67 61 72 3a 20 2b 28  syntax sugar: +(
06f0: 45 2c 20 45 29 0a 0a 63 6f 6d 6d 65 6e 74 20 69  E, E)..comment i
0700: 73 20 22 23 20 2e 2e 2e 20 5c 6e 22 0a 0a        s "# ... \n"..