Permalink
Browse files

stuff

  • Loading branch information...
1 parent cf12681 commit 93a6cb73cf236151369a62d73d9bb124de0847ff @oleganza committed May 24, 2009
Showing with 20 additions and 19 deletions.
  1. +5 −1 ecma-engine/IonGrammar.js
  2. +1 −18 ecma-engine/IonVM.js
  3. +14 −0 ecma-engine/IonVMTest.js
@@ -28,11 +28,15 @@ var IonGrammar = function(All, Any, Capture, Char, NotChar, Optional, Y, EOF, Te
return Y(function(MessageChain){
+ var idPrefix = Char("_qwertyuiopasdfghjklzxcvbnm$")
+ var idRest = Char("")
+ var id = All(idPrefix, Optional(Plus())) // a1, _a1, a1?, a1!, a1=
+
var assignment = All()
var solo = Any(assignment, call)
var tail = Any(statementTail, nextMessageTail)
return Any(All(solo, tail), solo)
})
-
+
}
View
@@ -1,8 +1,6 @@
-#!/usr/bin/env js
-
load("Util.js")
-var VM = (function(){
+var IonVM = (function(){
var lastObjectId = 0
@@ -289,18 +287,3 @@ var VM = (function(){
}) // VM
})()
-
-//
-// Test
-//
-
-if (true) {
- var verify = function(testName, message) {
- var vm = VM.clone()
- var result = vm.runMessage(message)
- print(result.sysType.name)
- }
-
- verify("test nil message", VM.Nil)
- //verify("test nil message", VM.Message.clone().setCachedResult(VM.))
-}
View
@@ -0,0 +1,14 @@
+#!/usr/bin/env js
+
+load("IonVM.js")
+load("IonGrammar.js")
+
+var verify = function(testName, message) {
+ var vm = IonVM.clone()
+ var result = vm.runMessage(message)
+ print(result.sysType.name)
+}
+
+verify("test nil message", IonVM.Nil)
+
+//verify("test nil message", VM.Message.clone().setCachedResult(VM.))

0 comments on commit 93a6cb7

Please sign in to comment.