8000 remove package statement · repos-javascript-compilers/JSX@982d22d · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 982d22d

Browse files
committed
remove package statement
1 parent 3268348 commit 982d22d

File tree

5 files changed

+2
-24
lines changed

5 files changed

+2
-24
lines changed

example/fib.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package com.example.fib;
2-
31
class Fib {
42

53
static function fib1(n : Int) : Int {

example/fizzbuzz.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package com.example.fizzbuzz;
2-
31
class FizzBuzz {
42
static function fizzbuzz() : Int {
53
for (var i = 1; i <= 100; ++i) {

example/hello.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package com.example.hello;
2-
31
class Hello {
42
static function main(/* JSX does not yet support array typedefs args : String[] */) : Int {
53
log "Hello, world!";

lib/Lexer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var Lexer = module.exports = Class.extend({
6767
// keywords of JSX
6868
"class", "extends", "super",
6969
"import", "implements",
70-
"interface", "package", "static",
70+
"interface", "static",
7171
"assert", "log",
7272
"__FILE__", "__LINE__"
7373
]);
@@ -84,7 +84,7 @@ var Lexer = module.exports = Class.extend({
8484
"extern", "native",
8585
"trait", "using",
8686
"as", "is",
87-
"operator"
87+
"operator", "package"
8888
]);
8989

9090
// some operators are not used, but recognized

lib/Parser.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ var Parser = module.exports = Class.extend({
5959
this._tokens = tokens;
6060
this._curToken = 0;
6161
this._errors = errors;
62-
this._package = "";
6362
this._classDefs = [];
6463
// use for function parsing
6564
this._locals = [];
@@ -68,9 +67,6 @@ var Parser = module.exports = Class.extend({
6867

6968
parse: function () {
7069

71-
if (! this._packageStatement())
72-
return false;
73-
7470
/* FIXME decide the syntax and implement
7571
while (this._importStatementOpt())
7672
;
@@ -195,18 +191,6 @@ var Parser = module.exports = Class.extend({
195191
}
196192
},
197193

198-
_packageStatement: function () {
199-
if (this._expectKeyword("package") == null)
200-
return false;
201-
var name = this._qualifiedName();
202-
if (name == null)
203-
return false;
204-
if (this._expectKeyword(";") == null)
205-
return false;
206-
this._package = name;
207-
return true;
208-
},
209-
210194
_qualifiedName: function () {
211195
var name = "";
212196
while (1) {

0 commit comments

Comments
 (0)
0