Skip to content

Commit

Permalink
merge of '86ea4e6c151b550a2a2b0fdf30a531ecf28cfa48'
Browse files Browse the repository at this point in the history
     and 'de67d4461a863c1ed6653067ee7ef65fc58a4573'

--HG--
branch : com.mozilla.es4.smlnj
extra : convert_revision : abec77e1d41b7e4d3425d4202d3092508d846a7e
  • Loading branch information
[email protected] committed Apr 26, 2007
2 parents 1610668 + ffad76d commit 9261492
Show file tree
Hide file tree
Showing 19 changed files with 2,743 additions and 2,480 deletions.
13 changes: 5 additions & 8 deletions ast.sml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ structure Ast = struct

type POS = { file: string, span: StreamPos.span, sm: StreamPos.sourcemap, post_newline: bool }

(* not actually unicode, maybe switch to int array to be unicode-y? *)

type USTRING = string

type IDENT = USTRING
type IDENT = Ustring.STRING

datatype NAMESPACE =
Intrinsic
Expand All @@ -18,7 +15,7 @@ datatype NAMESPACE =
| Protected of IDENT
| Public of IDENT
| Internal of IDENT
| UserNamespace of USTRING
| UserNamespace of Ustring.STRING
| AnonUserNamespace of int
| LimitedNamespace of (IDENT * NAMESPACE)

Expand Down Expand Up @@ -331,7 +328,7 @@ datatype PRAGMA =
openNamespaces : NAMESPACE list list }
| QualifiedIdentifier of
{ qual : EXPR,
ident : USTRING }
ident : Ustring.STRING }
| TypeIdentifier of (* in a type context, these this will be a AppType *)
{ ident : IDENT_EXPR,
typeArgs : TYPE_EXPR list }
Expand All @@ -349,7 +346,7 @@ datatype PRAGMA =
| LiteralInt of Int32.int
| LiteralUInt of Word32.word
| LiteralBoolean of bool
| LiteralString of USTRING
| LiteralString of Ustring.STRING
| LiteralArray of
{ exprs:EXPR list,
ty:TYPE_EXPR option }
Expand All @@ -360,7 +357,7 @@ datatype PRAGMA =
ty: TYPE_EXPR option }
| LiteralFunction of FUNC
| LiteralRegExp of
{ str: USTRING }
{ str: Ustring.STRING }

and BLOCK = Block of DIRECTIVES

Expand Down
10 changes: 5 additions & 5 deletions boot.sml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ fun boot _ =
let
val fullName = Name.public name

val _ = trace ["loading fundamental ", name, " class from builtin/", name ,".es"];
val prog = Defn.defProgram (Parser.parseFile ("builtins/" ^ name ^ ".es"))
val _ = trace ["loading fundamental ", Ustring.toString name, " class from builtin/", Ustring.toString name ,".es"];
val prog = Defn.defProgram (Parser.parseFile ("builtins/" ^ Ustring.toString name ^ ".es"))

val _ = trace ["fetching ", LogErr.name fullName, " class definition"];
val fix = Defn.getFixture (valOf (#fixtures prog)) (Ast.PropName fullName)
Expand Down Expand Up @@ -161,15 +161,15 @@ fun boot _ =
Eval.allocObjFixtures classRegs classObj (SOME classObj) instanceFixtures
end

val (objClass, objClassClosure, objClassObj, residualObjectProg) = loadRootClass "Object"
val (objClass, objClassClosure, objClassObj, residualObjectProg) = loadRootClass Ustring.Object_
val _ = trace ["running Object constructor on global object"];
val Ast.Cls { instanceFixtures, ...} = objClass
val objClassRegs = Eval.extendScopeReg globalRegs objClassObj Mach.InstanceScope
val _ = Eval.allocObjFixtures objClassRegs globalObj (SOME globalObj) instanceFixtures
val _ = Eval.initializeAndConstruct objClassClosure objClassObj objClassRegs [] globalObj

val (_, _, classClassObj, residualClassProg) = loadRootClass "Class"
val (_, _, functionClassObj, residualFunctionProg) = loadRootClass "Function"
val (_, _, classClassObj, residualClassProg) = loadRootClass Ustring.Class_
val (_, _, functionClassObj, residualFunctionProg) = loadRootClass Ustring.Function_

val _ = completeClassFixtures objClassObj
val _ = completeClassFixtures classClassObj
Expand Down
140 changes: 71 additions & 69 deletions defn.sml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions es4.cm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Library
structure Boot
structure Decimal
structure Name
structure Ustring
is
logerr.sml (lambdasplit: infinity)
main.sml
Expand All @@ -34,6 +35,7 @@ is
boot.sml
decimal.sml (lambdasplit: infinity)
name.sml (lambdasplit: infinity)
ustring.sml

$/basis.cm
$/smlnj-lib.cm
Expand Down
Loading

0 comments on commit 9261492

Please sign in to comment.