Comparing version 0.2.1 to 0.2.2
'use strict'; | ||
module.exports = { | ||
get_date$: { | ||
type: 'Function', | ||
builtin: true, | ||
paramTypes: [ | ||
], | ||
resultType: 'Int[]' | ||
}, | ||
get_time$: { | ||
type: 'Function', | ||
builtin: true, | ||
paramTypes: [ | ||
], | ||
resultType: 'Int' | ||
}, | ||
read$: { | ||
@@ -5,0 +19,0 @@ type: 'Function', |
@@ -9,2 +9,3 @@ 'use strict'; | ||
this.errorWriter = errorWriter; | ||
this.startTime = Date.now(); | ||
} | ||
@@ -99,2 +100,6 @@ | ||
Context.prototype.zrsh = function (left, right) { | ||
return (left >>> right) | 0; | ||
}; | ||
Context.prototype.add = function (left, right) { | ||
@@ -220,2 +225,6 @@ return this.checkOverflow(left + right); | ||
Context.prototype.zrshAt = function (values, index, value) { | ||
values[this.checkIndex(index, values.length)] = this.zrsh(values[index], value); | ||
}; | ||
Context.prototype.bandAt = function (values, index, value) { | ||
@@ -253,2 +262,20 @@ values[this.checkIndex(index, values.length)] = this.band(values[index], value); | ||
Context.prototype.get_date$ = function () { | ||
var date = new Date(); | ||
return [ | ||
date.getFullYear(), | ||
date.getMonth() + 1, | ||
date.getDate(), | ||
date.getHours(), | ||
date.getMinutes(), | ||
date.getSeconds(), | ||
date.getMilliseconds(), | ||
date.getTimezoneOffset(), | ||
]; | ||
}; | ||
Context.prototype.get_time$ = function () { | ||
return (Date.now() - this.startTime) | 0; | ||
}; | ||
Context.prototype.read$ = function (values, offset, length) { | ||
@@ -255,0 +282,0 @@ var line = this.inputReader.readLine(); |
@@ -15,2 +15,3 @@ 'use strict'; | ||
'>>': 'rsh', | ||
'>>>': 'zrsh', | ||
'+': 'add', | ||
@@ -17,0 +18,0 @@ '-': 'sub', |
{ | ||
"name": "introjs", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "IntroJS is a JavaScript implementation of the simplified programming language Intro.", | ||
@@ -5,0 +5,0 @@ "author": "introshu", |
@@ -119,2 +119,10 @@ # IntroJS | ||
``` | ||
def get_date(): Int[] | ||
``` | ||
``` | ||
def get_time(): Int | ||
``` | ||
``` | ||
def read(values: Int[], offset: Int, length: Int): Int | ||
@@ -121,0 +129,0 @@ ``` |
@@ -1,2 +0,2 @@ | ||
8 2 15 1 1 2 2 40 0 1 7 6 | ||
8 2 15 1 1 2 2 40 0 1 7 6 | ||
8 2 15 1 1 2 2 40 0 0 1 7 6 | ||
8 2 15 1 1 2 2 40 0 0 1 7 6 |
@@ -12,2 +12,3 @@ 'use strict'; | ||
'./test/assignments/assignments.intro', | ||
'./test/builtins/builtins.intro', | ||
'./test/expressions/expressions.intro', | ||
@@ -14,0 +15,0 @@ './test/literals/literals.intro', |
@@ -69,2 +69,12 @@ | ||
-5 | ||
-3 | ||
-2 | ||
-5 | ||
2147483645 | ||
1073741822 | ||
1 | ||
@@ -75,8 +85,3 @@ 7 | ||
5 | ||
2 | ||
1 | ||
1 | ||
0 | ||
@@ -83,0 +88,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227577
87
6775
174