factor: trim more whitespace from #! comments

db4
Doug Coleman 2015-07-18 20:36:42 -07:00
parent 4ec2311406
commit 9fb130791b
5 changed files with 14 additions and 14 deletions

View File

@ -254,20 +254,20 @@ IN: peg.ebnf.tests
] must-fail ] must-fail
{ V{ V{ 49 } "+" V{ 49 } } } [ { V{ V{ 49 } "+" V{ 49 } } } [
#! Test direct left recursion. #! Test direct left recursion.
#! Using packrat, so first part of expr fails, causing 2nd choice to be used #! Using packrat, so first part of expr fails, causing 2nd choice to be used
"1+1" [EBNF num=([0-9])+ expr=expr "+" num | num EBNF] "1+1" [EBNF num=([0-9])+ expr=expr "+" num | num EBNF]
] unit-test ] unit-test
{ V{ V{ V{ 49 } "+" V{ 49 } } "+" V{ 49 } } } [ { V{ V{ V{ 49 } "+" V{ 49 } } "+" V{ 49 } } } [
#! Test direct left recursion. #! Test direct left recursion.
#! Using packrat, so first part of expr fails, causing 2nd choice to be used #! Using packrat, so first part of expr fails, causing 2nd choice to be used
"1+1+1" [EBNF num=([0-9])+ expr=expr "+" num | num EBNF] "1+1+1" [EBNF num=([0-9])+ expr=expr "+" num | num EBNF]
] unit-test ] unit-test
{ V{ V{ V{ 49 } "+" V{ 49 } } "+" V{ 49 } } } [ { V{ V{ V{ 49 } "+" V{ 49 } } "+" V{ 49 } } } [
#! Test indirect left recursion. #! Test indirect left recursion.
#! Using packrat, so first part of expr fails, causing 2nd choice to be used #! Using packrat, so first part of expr fails, causing 2nd choice to be used
"1+1+1" [EBNF num=([0-9])+ x=expr expr=x "+" num | num EBNF] "1+1+1" [EBNF num=([0-9])+ x=expr expr=x "+" num | num EBNF]
] unit-test ] unit-test

View File

@ -26,7 +26,7 @@ SYMBOL: serialized
serialized get [ assoc-size swap ] keep set-at ; serialized get [ assoc-size swap ] keep set-at ;
: object-id ( obj -- id ) : object-id ( obj -- id )
#! Return the id of an already serialized object #! Return the id of an already serialized object
serialized get at ; serialized get at ;
! Numbers are serialized as follows: ! Numbers are serialized as follows:

View File

@ -5,16 +5,16 @@ peg peg.ebnf peg.javascript.ast peg.javascript.tokenizer ;
IN: peg.javascript.parser IN: peg.javascript.parser
#! Grammar for JavaScript. Based on OMeta-JS example from: #! Grammar for JavaScript. Based on OMeta-JS example from:
#! http://jarrett.cs.ucla.edu/ometa-js/#JavaScript_Compiler #! http://jarrett.cs.ucla.edu/ometa-js/#JavaScript_Compiler
#! The interesting thing about this parser is the mixing of #! The interesting thing about this parser is the mixing of
#! a default and non-default tokenizer. The JavaScript tokenizer #! a default and non-default tokenizer. The JavaScript tokenizer
#! removes all newlines. So when operating on tokens there is no #! removes all newlines. So when operating on tokens there is no
#! need for newline and space skipping in the grammar. But JavaScript #! need for newline and space skipping in the grammar. But JavaScript
#! uses the newline in the 'automatic semicolon insertion' rule. #! uses the newline in the 'automatic semicolon insertion' rule.
#! #!
#! If a statement ends in a newline, sometimes the semicolon can be #! If a statement ends in a newline, sometimes the semicolon can be
#! skipped. So we define an 'nl' rule using the default tokenizer. #! skipped. So we define an 'nl' rule using the default tokenizer.
#! This operates a character at a time. Using this 'nl' in the parser #! This operates a character at a time. Using this 'nl' in the parser
#! allows us to detect newlines when we need to for the semicolon #! allows us to detect newlines when we need to for the semicolon
#! insertion rule, but ignore it in all other places. #! insertion rule, but ignore it in all other places.

View File

@ -4,7 +4,7 @@ USING: kernel sequences strings arrays math.parser peg peg.ebnf peg.javascript.a
IN: peg.javascript.tokenizer IN: peg.javascript.tokenizer
#! Grammar for JavaScript. Based on OMeta-JS example from: #! Grammar for JavaScript. Based on OMeta-JS example from:
#! http://jarrett.cs.ucla.edu/ometa-js/#JavaScript_Compiler #! http://jarrett.cs.ucla.edu/ometa-js/#JavaScript_Compiler
USE: prettyprint USE: prettyprint

View File

@ -30,7 +30,7 @@ CONSTANT: game-height 256
color third index 2 + bitmap set-nth ; color third index 2 + bitmap set-nth ;
: get-bitmap-pixel ( point array -- color ) : get-bitmap-pixel ( point array -- color )
#! Point is a {x y}. color is a {r g b} #! Point is a {x y}. color is a {r g b}
[ bitmap-index ] dip [ bitmap-index ] dip
[ nth ] [ nth ]
[ [ 1 + ] dip nth ] [ [ 1 + ] dip nth ]
@ -164,7 +164,7 @@ M: space-invaders read-port
#! Bit 1 = invaders sound 2 #! Bit 1 = invaders sound 2
#! Bit 2 = invaders sound 3 #! Bit 2 = invaders sound 3
#! Bit 3 = invaders sound 4 #! Bit 3 = invaders sound 4
#! Bit 4 = spaceship hit #! Bit 4 = spaceship hit
#! Bit 5 = amplifier enabled/disabled #! Bit 5 = amplifier enabled/disabled
2dup 0 port5-newly-set? [ dup SOUND-WALK1 play-invaders-sound ] when 2dup 0 port5-newly-set? [ dup SOUND-WALK1 play-invaders-sound ] when
2dup 1 port5-newly-set? [ dup SOUND-WALK2 play-invaders-sound ] when 2dup 1 port5-newly-set? [ dup SOUND-WALK2 play-invaders-sound ] when
@ -336,7 +336,7 @@ M: space-invaders update-video
system:nano-count ; system:nano-count ;
: invaders-process ( micros gadget -- ) : invaders-process ( micros gadget -- )
#! Run a space invaders gadget inside a #! Run a space invaders gadget inside a
#! concurrent process. Messages can be sent to #! concurrent process. Messages can be sent to
#! signal key presses, etc. #! signal key presses, etc.
dup quit?>> [ dup quit?>> [