Permalink
Browse files

Top removal: basic smart constructors, symbol table

  • Loading branch information...
1 parent d874a8e commit 202e70069ba4d837625659111a1945b54e65a615 @sorear committed Nov 12, 2012
Showing with 424 additions and 399 deletions.
  1. +175 −206 lib/Builtins.cs
  2. +9 −9 lib/CodeGen.cs
  3. +3 −3 lib/Cursor.cs
  4. +60 −60 lib/GeneratedTrigFunctions.cs
  5. +1 −1 lib/JSYNC.cs
  6. +144 −89 lib/Kernel.cs
  7. +10 −10 lib/NieczaCLR.cs
  8. +2 −2 lib/ObjModel.cs
  9. +10 −9 lib/UCD.cs
  10. +10 −10 tools/make_trig_code.pl
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -3088,8 +3088,6 @@ class NamProcessor {
thandlers["rxstripcaps"] = Methody(null, Tokens.Cursor.GetMethod("StripCaps"));
thandlers["prog"] = CpsOp.Sequence;
- thandlers["newarray"] = Methody(null, Tokens.Kernel_CreateArray);
- thandlers["newhash"] = Methody(null, Tokens.Kernel_CreateHash);
thandlers["shift"] = Contexty("mro_shift");
thandlers["pop"] = Contexty("mro_pop");
@@ -3844,16 +3842,18 @@ public class DowncallReceiver : CallReceiver {
return r;
}
public static object unit_string_constant(object[] args) {
- return Handle.Wrap(Builtins.MakeStr((string)args[2]));
+ RuntimeUnit c = (RuntimeUnit)Handle.Unbox(args[1]);
+ return Handle.Wrap(c.setting.MakeStr((string)args[2]));
}
public static object unit_numeric_constant(object[] args) {
+ RuntimeUnit c = (RuntimeUnit)Handle.Unbox(args[1]);
if (args.Length == 4) {
int bas = (int)args[2];
string digits = (string)args[3];
- return Handle.Wrap(EmitUnit.ExactNum(bas, digits));
+ return Handle.Wrap(EmitUnit.ExactNum(c.setting, bas, digits));
} else {
double d = (args[2] is double) ? (double)args[2] : (int)args[2];
- return Handle.Wrap(Builtins.MakeFloat(d));
+ return Handle.Wrap(c.setting.MakeFloat(d));
}
}
public static object sub_run_BEGIN_raw(object[] args) {
@@ -4415,7 +4415,7 @@ public class DowncallReceiver : CallReceiver {
if (outer == null) {
/* Hack - embed build information */
var info = new VarHash();
- info["name"] = Builtins.MakeStr("niecza");
+ info["name"] = ru.setting.MakeStr("niecza");
string vers = "(unknown)\n";
try {
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
@@ -4424,9 +4424,9 @@ public class DowncallReceiver : CallReceiver {
} catch (Exception) {
// ignore
}
- info["version"] = Builtins.MakeStr(
+ info["version"] = ru.setting.MakeStr(
vers.Substring(0, vers.Length - 1));
- info["build-time"] = Builtins.now();
+ info["build-time"] = Builtins.now(new Constants { setting = ru.setting });
var li = new LIConstant(Kernel.BoxAnyMO(info, ru.setting.HashMO));
@@ -4655,7 +4655,7 @@ public class DowncallReceiver : CallReceiver {
Frame fret = null;
ru.setting.check.Run();
ru.setting.init.Run();
- StashEnt b = Kernel.GetVar("::PROCESS", "$OUTPUT_USED");
+ StashEnt b = ru.setting.GetVar("::PROCESS", "$OUTPUT_USED");
b.Bind(ru.setting.FalseV);
Frame ir = Kernel.GetInferiorRoot();
fret = ru.mainline.protosub.Invoke(ir, Variable.None, null);
View
@@ -276,7 +276,7 @@ public sealed class RxFrame: IFreeze {
// field to the backtrack state.
public void SetEndpoint(string which) {
flags |= USED_ENDS;
- PushCapture(new string[] { null, which }, Builtins.MakeInt(st.pos));
+ PushCapture(new string[] { null, which }, global.setting.MakeInt(st.pos));
}
public void IncorporateChild(string[] names, P6any match) {
@@ -359,7 +359,7 @@ public sealed class RxFrame: IFreeze {
public void PushGoal(Frame th, string newGoal) {
bt = new Choice(bt, -1, st);
bt.st.subrule_iter = th.LexicalFind("$*GOAL");
- th.LexicalBind("$*GOAL", Builtins.MakeStr(newGoal));
+ th.LexicalBind("$*GOAL", global.setting.MakeStr(newGoal));
st.ns = new NState(bt, "GOAL", st.ns);
st.ns.quant = st.pos;
}
@@ -987,7 +987,7 @@ public partial class Builtins {
if (!it.cap.Fetch().Isa(s.MatchMO))
continue;
foreach (string name in it.names)
- dq.Unshift(pair(MakeStr(name), it.cap));
+ dq.Unshift(pair(s.MakeStr(name), it.cap));
}
P6opaque lst = new P6opaque(s.ListMO);
Oops, something went wrong.

0 comments on commit 202e700

Please sign in to comment.