nested-comments: remove this vocab. we have /* */ which is good enough for now.

broken case:
(*
: print-broken ( -- ) "*)" ;
*)

not worth fixing, please don't bring this back :)
its functionality will be replaced soon.
db4
Doug Coleman 2015-07-21 12:07:53 -07:00
parent 280177279a
commit cf0cb4aedc
7 changed files with 8 additions and 82 deletions

View File

@ -1,7 +1,7 @@
USING: accessors alien alien.c-types alien.data alien.syntax USING: accessors alien alien.c-types alien.data alien.syntax
arrays byte-arrays classes.struct destructors fry io arrays byte-arrays classes.struct destructors fry io
io.encodings.string io.encodings.utf16n kernel literals locals io.encodings.string io.encodings.utf16n kernel literals locals
math nested-comments sequences strings system tools.ps math sequences strings system tools.ps
windows.errors windows.handles windows.kernel32 windows.ntdll windows.errors windows.handles windows.kernel32 windows.ntdll
windows.types ; windows.types ;
IN: tools.ps.windows IN: tools.ps.windows

View File

@ -3,7 +3,7 @@
USING: alien.c-types byte-arrays kernel locals sequences USING: alien.c-types byte-arrays kernel locals sequences
windows.advapi32 windows.errors math windows windows.advapi32 windows.errors math windows
windows.kernel32 windows.time accessors alien.data windows.kernel32 windows.time accessors alien.data
nested-comments windows.types classes.struct continuations ; windows.types classes.struct continuations ;
IN: windows.registry IN: windows.registry
ERROR: open-key-failed key subkey mode error-string ; ERROR: open-key-failed key subkey mode error-string ;

View File

@ -1,7 +1,6 @@
! Copyright (C) 2009 Doug Coleman. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: tools.test c.preprocessor kernel accessors multiline USING: tools.test c.preprocessor kernel accessors multiline ;
nested-comments ;
IN: c.preprocessor.tests IN: c.preprocessor.tests
[ "vocab:c/tests/test1/test1.c" start-preprocess-file ] [ "vocab:c/tests/test1/test1.c" start-preprocess-file ]
@ -10,18 +9,10 @@ IN: c.preprocessor.tests
{ "yo\n\n\n\nyo4\n" } { "yo\n\n\n\nyo4\n" }
[ "vocab:c/tests/test2/test2.c" start-preprocess-file nip ] unit-test [ "vocab:c/tests/test2/test2.c" start-preprocess-file nip ] unit-test
(* /*
[ "vocab:c/tests/test3/test3.c" start-preprocess-file ] [ "vocab:c/tests/test3/test3.c" start-preprocess-file ]
[ "\"BOO\"" = ] must-fail-with [ "\"BOO\"" = ] must-fail-with
*) */
{ V{ "\"omg\"" "\"lol\"" } } { V{ "\"omg\"" "\"lol\"" } }
[ "vocab:c/tests/test4/test4.c" start-preprocess-file drop warnings>> ] unit-test [ "vocab:c/tests/test4/test4.c" start-preprocess-file drop warnings>> ] unit-test
(*
f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
int i[] = { 1, 23, 4, 5, };
char c[2][6] = { "hello", "" };
*)

View File

@ -6,7 +6,7 @@ combinators.short-circuit constructors continuations destructors
forestdb.ffi forestdb.utils fry generalizations io.directories forestdb.ffi forestdb.utils fry generalizations io.directories
io.encodings.string io.encodings.utf8 io.files.temp io.pathnames io.encodings.string io.encodings.utf8 io.files.temp io.pathnames
kernel layouts libc make math math.parser math.ranges multiline kernel layouts libc make math math.parser math.ranges multiline
namespaces sequences system tools.test nested-comments ; namespaces sequences system tools.test ;
IN: forestdb.lib IN: forestdb.lib
{ [ cell-bits 32 = ] [ os windows? ] } 0&& [ { [ cell-bits 32 = ] [ os windows? ] } 0&& [

View File

@ -1,43 +0,0 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors eval kernel lexer nested-comments tools.test ;
IN: nested-comments.tests
! Correct
{ } [
"USE: nested-comments (* comment *)" eval( -- )
] unit-test
{ } [
"USE: nested-comments (* comment*)" eval( -- )
] unit-test
{ } [
"USE: nested-comments (* comment
*)" eval( -- )
] unit-test
{ } [
"USE: nested-comments (* comment
*)" eval( -- )
] unit-test
{ } [
"USE: nested-comments (* comment
*)" eval( -- )
] unit-test
{ } [
"USE: nested-comments (* comment
(* *)
*)" eval( -- )
] unit-test
! Malformed
[
"USE: nested-comments (* comment
(* *)" eval( -- )
] [
error>> T{ unexpected f "*)" f } =
] must-fail-with

View File

@ -1,22 +0,0 @@
! Copyright (C) 2009 blei, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel locals make math multiline sequences ;
IN: nested-comments
: (count-subsequences) ( count substring string n -- count' )
[ 2dup ] dip start* [
pick length +
[ 1 + ] 3dip (count-subsequences)
] [
2drop
] if* ;
: count-subsequences ( subseq seq -- n )
[ 0 ] 2dip 0 (count-subsequences) ;
: parse-nestable-comment ( parsed-vector left-to-parse -- parsed-vector )
1 - "*)" parse-multiline-string
[ "(*" ] dip
count-subsequences + dup 0 > [ parse-nestable-comment ] [ drop ] if ;
SYNTAX: (* 1 parse-nestable-comment ;

View File

@ -1,8 +1,8 @@
! Copyright (C) 2011 Doug Coleman. ! Copyright (C) 2011 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors calendar fonts fry io io.files io.files.info USING: accessors calendar fonts fry io io.files io.files.info
kernel math models models.arrow namespaces nested-comments kernel math models models.arrow namespaces progress-bars
progress-bars threads ui.gadgets.labels ui.gadgets.panes ; threads ui.gadgets.labels ui.gadgets.panes ;
IN: progress-bars.models IN: progress-bars.models
SYMBOL: progress-bar SYMBOL: progress-bar