Permalink
Browse files

Pass the TerpEtude text styles

  • Loading branch information...
1 parent 50f84e3 commit 1f4a34f5cd9081ef7744ffddcc77065ee416e4f8 @curiousdannii committed Oct 10, 2011
View
@@ -122,7 +122,7 @@
output.close()
# Compress!
- command = 'java -jar tools/yuicompressor-2.4.2.jar --type js .build/temp -o .build/temp'
+ command = 'java -jar tools/yuicompressor-2.4.2.jar --type ' + (package[1].endswith('.js') and 'js' or 'css' ) + ' .build/temp -o .build/temp'
os.system(command)
data = file('.build/temp').read()
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,3 +1,14 @@
+/*
+
+General Parchment styles
+========================
+
+Copyright (c) 2008-2011 The Parchment Contributors
+BSD licenced
+http://code.google.com/p/parchment
+
+*/
+
html
{
overflow-y: scroll;
@@ -6,7 +17,10 @@ html
body
{
+ background: #FFF;
+ color: #000;
font-family: Georgia, Palatino, serif;
+ font-size: 16px;
margin: 0 0 8px;
text-align: center;
}
@@ -19,84 +33,15 @@ body
width: 80%;
}
-.fg-default {
- color: black;
-}
-
-.fg-default-reversed {
- color: white;
-}
-
-.fg-black {
- color: black;
-}
-
-.fg-red {
- color: red;
-}
-
-.fg-green {
- color: green;
-}
-
-.fg-yellow {
- color: yellow;
-}
-
-.fg-blue {
- color: blue;
-}
-
-.fg-magenta {
- color: magenta;
-}
-
-.fg-cyan {
- color: cyan;
-}
-
-.fg-white {
- color: white;
-}
-
-.bg-default {
- background: white;
-}
-
-.bg-default-reversed {
- background: black;
-}
-
-.bg-black {
- background: black;
-}
-
-.bg-red {
- background: red;
-}
-
-.bg-green {
- background: green;
-}
-
-.bg-yellow {
- background: yellow;
-}
-
-.bg-blue {
- background: blue;
-}
-
-.bg-magenta {
- background: magenta;
-}
-
-.bg-cyan {
- background: cyan;
+tt
+{
+ font-family: monaco, andale mono, lucidatypewriter, courier, courier new, monospaced;
+ line-height: 1;
}
-.bg-white {
- background: white;
+.reverse
+{
+ padding: 0 2px;
}
.buffered-window {
@@ -176,32 +121,6 @@ body
width: 50%;
}
-.z-roman {
-}
-
-.z-bold {
- font-variant: small-caps;
-}
-
-.z-italic {
- font-style: italic;
-}
-
-.z-fixed-pitch {
- font-family: monaco, andale mono, lucidatypewriter, courier, courier new, monospace;
- white-space: pre;
- font-size: 10pt;
-}
-
-.z-breaking-whitespace {
- white-space: normal;
-}
-
-#top-window .z-bold {
- text-decoration: underline;
- font-variant: normal;
-}
-
.error {
background: red;
color: white;
@@ -0,0 +1,115 @@
+/*
+
+Styles for the Gnusto runner
+============================
+
+Copyright (c) 2008-2011 The Parchment Contributors
+BSD licenced
+http://code.google.com/p/parchment
+
+*/
+.fg-default {
+ color: black;
+}
+
+.fg-default-reversed {
+ color: white;
+}
+
+.fg-black {
+ color: black;
+}
+
+.fg-red {
+ color: red;
+}
+
+.fg-green {
+ color: green;
+}
+
+.fg-yellow {
+ color: yellow;
+}
+
+.fg-blue {
+ color: blue;
+}
+
+.fg-magenta {
+ color: magenta;
+}
+
+.fg-cyan {
+ color: cyan;
+}
+
+.fg-white {
+ color: white;
+}
+
+.bg-default {
+ background: white;
+}
+
+.bg-default-reversed {
+ background: black;
+}
+
+.bg-black {
+ background: black;
+}
+
+.bg-red {
+ background: red;
+}
+
+.bg-green {
+ background: green;
+}
+
+.bg-yellow {
+ background: yellow;
+}
+
+.bg-blue {
+ background: blue;
+}
+
+.bg-magenta {
+ background: magenta;
+}
+
+.bg-cyan {
+ background: cyan;
+}
+
+.bg-white {
+ background: white;
+}
+
+.z-roman {
+}
+
+.z-bold {
+ font-variant: small-caps;
+}
+
+.z-italic {
+ font-style: italic;
+}
+
+.z-fixed-pitch {
+ font-family: monaco, andale mono, lucidatypewriter, courier, courier new, monospace;
+ white-space: pre;
+ font-size: 10pt;
+}
+
+.z-breaking-whitespace {
+ white-space: normal;
+}
+
+#top-window .z-bold {
+ text-decoration: underline;
+ font-variant: normal;
+}
@@ -154,6 +154,8 @@ Brancher = Opcode.subClass({
// Flag for the disassembler
brancher: 1,
+ keyword: 'if',
+
// Process the branch result now
post: function()
{
@@ -237,7 +239,7 @@ Brancher = Opcode.subClass({
}
// Print out a label for all included branches and the branch itself
- return '/* ' + this.labels.join() + ' */ ' + ( this.invert ? 'if (!(' : 'if (' ) +
+ return '/* ' + this.labels.join() + ' */ ' + this.keyword + ( this.invert ? '(!(' : '(' ) +
this.ops.join( '||' ) + ( this.invert ? ')) {' : ') {' ) + result + '}';
}
}),
@@ -15,6 +15,7 @@ Todo:
consider whether direct array access would help (what did i mean by this???)
is signed access needed?
add a system for guards, to run callbacks if certain addresses were written to
+ Needed for: @storew, @storeb, @output_stream?, @encode_text, @copy_table, @restore, @restore_undo
check whether returning the set values is bad for perf
consider generic funcs for set/get: get=Uint8(0), set=Uint8(0,0)
@@ -13,37 +13,56 @@ http://github.com/curiousdannii/ifvms.js
TODO:
loops
+ doesn't work yet because of storers before the branch
break (& continue?)
*/
// Block if statements
var idiom_if_block = function( context, pc )
{
+ var i = 0,
+ subcontext,
+ sublen,
+ brancher,
+ lastop;
+
// First, find the branch opcode
// (-1 because we don't want to catch the very last opcode, not that it should ever branch to the following statement)
- for ( var i = 0, subcontext; i < context.ops.length - 1; i++ )
+ while ( i < context.ops.length - 1 )
{
// As long as no other opcodes have an offset property we can skip the instanceof check
if ( /* context.ops[i] instanceof Brancher && */ context.ops[i].offset == pc )
{
// Make a new Context to contain all of the following opcodes
- subcontext = new Context( context.e, context.ops[i + 1] );
+ subcontext = new Context( context.e, context.ops[i + 1].pc );
subcontext.ops = context.ops.slice( i + 1 );
+ sublen = subcontext.ops.length - 1;
context.ops.length = i + 1;
update_contexts( subcontext.ops, subcontext );
// Set that Context as the branch's target, and invert its condition
- context.ops[i].result = subcontext;
- context.ops[i].invert = !context.ops[i].invert;
+ brancher = context.ops[i];
+ brancher.result = subcontext;
+ brancher.invert = !brancher.invert;
- // Mark this subcontext as a stopper if its last opcode is
- subcontext.stopper = subcontext.ops[subcontext.ops.length - 1].stopper;
+ // Check if this is actually a loop
+ lastop = subcontext.ops[sublen];
+ if ( lastop.code == 140 && ( U2S( lastop.operands[0].v ) + lastop.next - 2 ) == brancher.pc )
+ {
+ brancher.keyword = 'while';
+ subcontext.ops.pop();
+ }
+ else
+ {
+ // Mark this subcontext as a stopper if its last opcode is
+ subcontext.stopper = lastop.stopper;
+ }
/* DEBUG */
// Check whether this could be a complex condition
var allbranches = 1;
- for ( i = 0; i < subcontext.ops.length; i++ )
+ for ( i = 0; i < sublen + 1; i++ )
{
if ( !( subcontext.ops[i] instanceof Brancher ) )
{
@@ -52,13 +71,14 @@ var idiom_if_block = function( context, pc )
}
if ( allbranches == 1 )
{
- log( 'Potential complex condition in: ' + context.pc );
+ console.info( 'Potential complex condition in ' + context.pc + ' at ' + brancher.pc );
}
/* ENDDEBUG */
// Return 1 to signal that we can continue past the stopper
return 1;
}
+ i++;
}
},
@@ -16,6 +16,7 @@ Note:
TODO:
implement proper errors for missing opcodes
+ If we diassessemble part of what we already have before, can we just copy/slice the context?
*/
@@ -160,7 +161,7 @@ var disassemble = function( engine )
if ( opcode_class.printer )
{
temp = engine.text.decode( pc );
- operands.push( engine.text.escape( temp ) );
+ operands.push( JITescape( temp ) );
pc = temp.pc;
}
Oops, something went wrong.

0 comments on commit 1f4a34f

Please sign in to comment.