Permalink
Browse files

Используем ometa-js из отдельной папки.

  • Loading branch information...
1 parent ff59849 commit 77886f408a05ebaf4a32ababeb1364bfae0c9fe4 @veged committed Nov 1, 2009
Showing with 28 additions and 13 deletions.
  1. +1 −1 get-ometajs
  2. +7 −7 ometa-highlighter2html.html
  3. +1 −0 tests.html
  4. +9 −2 translate.js
  5. +10 −3 v8cgi-ometa-highlighter2html.js
View
@@ -1,2 +1,2 @@
#!/bin/bash
-svn co http://www.tinlizzie.org/~awarth/svn/ometa-js .
+svn co http://www.tinlizzie.org/~awarth/svn/ometa-js
@@ -1,12 +1,12 @@
<html>
<head>
- <script src="lib.js"></script>
- <script src="ometa-base.js"></script>
- <script src="parser.js"></script>
- <script src="bs-js-compiler.js"></script>
- <script src="bs-ometa-compiler.js"></script>
- <script src="bs-ometa-optimizer.js"></script>
- <script src="bs-ometa-js-compiler.js"></script>
+ <script src="ometa-js/lib.js"></script>
+ <script src="ometa-js/ometa-base.js"></script>
+ <script src="ometa-js/parser.js"></script>
+ <script src="ometa-js/bs-js-compiler.js"></script>
+ <script src="ometa-js/bs-ometa-compiler.js"></script>
+ <script src="ometa-js/bs-ometa-optimizer.js"></script>
+ <script src="ometa-js/bs-ometa-js-compiler.js"></script>
<script src="ometa-highlighter.js"></script>
<script src="ometa-highlighter2html.js"></script>
View
@@ -77,6 +77,7 @@
<?xml-stylesheet type="text/xsl" href="pagename.xsl"?>
<page name="pagename" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="subpagename.xml"/>
+ text&#160;text
</page>
</textarea>
</div>
View
@@ -1,7 +1,14 @@
#!/usr/bin/env v8cgi
if (!load && include && system.getcwd)
- var load = function(f) { return eval.call(global, new File(system.getcwd() + '/' + f).open("r").read()) };
+ var load = function(f) {
+ var oldLoad = load;
+ if (f.indexOf('/') != -1)
+ global.load = function(ff){ return oldLoad(f.replace(/[^\/]+$/, '') + ff) };
+ var result = eval.call(global, new File(system.getcwd() + '/' + f).open("r").read());
+ global.load = oldLoad;
+ return result;
+ };
if (!print && system.stdout)
var print = function(d) { return system.stdout(d + '\n') };
@@ -44,7 +51,7 @@ if (o.get('help')) {
var input = f.read();
f.close();
- load('ometa-rhino.js');
+ load('ometa-js/ometa-rhino.js');
var result = translateCode(input);
@@ -1,7 +1,14 @@
#!/usr/bin/env v8cgi
if (!load && include && system.getcwd)
- var load = function(f) { return eval.call(global, new File(system.getcwd() + '/' + f).open("r").read()) };
+ var load = function(f) {
+ var oldLoad = load;
+ if (f.indexOf('/') != -1)
+ global.load = function(ff){ return oldLoad(f.replace(/[^\/]+$/, '') + ff) };
+ var result = eval.call(global, new File(system.getcwd() + '/' + f).open("r").read());
+ global.load = oldLoad;
+ return result;
+ };
if (!print && system.stdout)
var print = function(d) { return system.stdout(d + '\n') };
@@ -16,7 +23,7 @@ o.add('help', 'Print help message', false, 'h', 'help');
o.add('output', 'Output file', '', 'o', 'output', GetOpt.REQUIRED_ARGUMENT);
function help() {
- system.stdout('Usage: ./translate.js [options] input file\n\n');
+ system.stdout('Usage: ./v8cgi-ometa-highlighter2html.js [options] input file\n\n');
system.stdout(o.help());
}
@@ -44,7 +51,7 @@ if (o.get('help')) {
var input = f.read();
f.close();
- load('ometa-rhino.js');
+ load('ometa-js/ometa-rhino.js');
load('ometa-highlighter.js');
load('ometa-highlighter2html.js');

0 comments on commit 77886f4

Please sign in to comment.