Browse files

add an JSX example

  • Loading branch information...
1 parent 9aff50b commit ef6e3e4677c960f18d4abaad79ad62228237a95e @gfx committed Jul 16, 2012
Showing with 19 additions and 4 deletions.
  1. +2 −0 .gitignore
  2. +8 −2 Makefile
  3. +2 −2 hello.js
  4. +7 −0 hello.jsx
View
2 .gitignore
@@ -1,3 +1,5 @@
*~
*.swp
nore
+*.jsx.js
+
View
10 Makefile
@@ -1,8 +1,14 @@
OPTIMIZE := -O4
-hello: nore
- ./nore hello.js
+all: jshello jsxhello
+
+jshello: nore
+ ./nore hello.js foo bar
+
+jsxhello: nore
+ jsx --output hello.jsx.js --executable node hello.jsx
+ ./nore hello.jsx.js foo bar
nore: main.c
$(CC) $(OPTIMIZE) -Wall -Wextra -g -framework JavaScriptCore -o $@ $<
View
4 hello.js
@@ -1,4 +1,4 @@
-
-console.log("hello, world!");
+#!nore
+console.log("Hello, JavaScript!");
console.log("argv: " + JSON.stringify(process.argv));
View
7 hello.jsx
@@ -0,0 +1,7 @@
+
+class _Main {
+ static function main(args : string[]) : void {
+ log "Hello, JSX!";
+ log "argv: " + JSON.stringify(args);
+ }
+}

0 comments on commit ef6e3e4

Please sign in to comment.