alien.debugger: this vocab isn't needed
The summary methods doesn't need dedicated vocabs. Unlike prettyprint methods.char-rename
parent
e3f6999519
commit
b418b434fa
|
@ -1 +0,0 @@
|
||||||
Joe Groff
|
|
|
@ -1,10 +0,0 @@
|
||||||
! Copyright (C) 2010 Joe Groff.
|
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
|
||||||
USING: accessors alien.c-types alien.parser prettyprint
|
|
||||||
sequences summary ;
|
|
||||||
IN: alien.debugger
|
|
||||||
|
|
||||||
M: no-c-type summary name>> unparse "“" "” is not a C type" surround ;
|
|
||||||
|
|
||||||
M: *-in-c-type-name summary
|
|
||||||
name>> "Cannot define a C type “" "” that ends with an asterisk (*)" surround ;
|
|
|
@ -1,8 +1,8 @@
|
||||||
! (c)2009 Joe Groff bsd license
|
! (c)2009 Joe Groff bsd license
|
||||||
USING: accessors alien.c-types alien.parser alien.parser.private
|
USING: accessors alien.c-types alien.parser alien.parser.private
|
||||||
alien.syntax compiler.units continuations debugger eval fry kernel
|
alien.syntax compiler.units continuations debugger eval fry kernel
|
||||||
lexer namespaces parser sequences sets tools.test vocabs.parser words
|
lexer namespaces parser sequences sets summary tools.test
|
||||||
;
|
vocabs.parser words ;
|
||||||
IN: alien.parser.tests
|
IN: alien.parser.tests
|
||||||
|
|
||||||
<<
|
<<
|
||||||
|
@ -46,6 +46,11 @@ IN: alien.parser.tests
|
||||||
{ "ayae" } [ parse-enum-name new-definitions get first in? ] with-parsing
|
{ "ayae" } [ parse-enum-name new-definitions get first in? ] with-parsing
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! validate-c-type-name
|
||||||
|
{ "Cannot define a C type “hello*” that ends with an asterisk (*)" } [
|
||||||
|
[ "hello*" validate-c-type-name ] [ ] recover summary
|
||||||
|
] unit-test
|
||||||
|
|
||||||
>>
|
>>
|
||||||
|
|
||||||
TYPEDEF: char char2
|
TYPEDEF: char char2
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: accessors alien alien.c-types alien.enums alien.libraries
|
USING: accessors alien alien.c-types alien.enums alien.libraries
|
||||||
arrays classes classes.parser combinators combinators.short-circuit
|
arrays classes classes.parser combinators combinators.short-circuit
|
||||||
compiler.units effects fry kernel lexer locals math namespaces parser
|
compiler.units effects fry kernel lexer locals math namespaces parser
|
||||||
sequences splitting vocabs.parser words ;
|
sequences splitting summary vocabs.parser words ;
|
||||||
IN: alien.parser
|
IN: alien.parser
|
||||||
|
|
||||||
SYMBOL: current-library
|
SYMBOL: current-library
|
||||||
|
@ -54,6 +54,11 @@ ERROR: bad-array-type ;
|
||||||
|
|
||||||
ERROR: *-in-c-type-name name ;
|
ERROR: *-in-c-type-name name ;
|
||||||
|
|
||||||
|
M: *-in-c-type-name summary
|
||||||
|
name>>
|
||||||
|
"Cannot define a C type “"
|
||||||
|
"” that ends with an asterisk (*)" surround ;
|
||||||
|
|
||||||
: validate-c-type-name ( name -- name )
|
: validate-c-type-name ( name -- name )
|
||||||
dup "*" tail?
|
dup "*" tail?
|
||||||
[ *-in-c-type-name ] when ;
|
[ *-in-c-type-name ] when ;
|
||||||
|
|
|
@ -16,7 +16,6 @@ IN: bootstrap.compiler
|
||||||
] unless
|
] unless
|
||||||
|
|
||||||
{ "boostrap.compiler" "prettyprint" } "alien.prettyprint" require-when
|
{ "boostrap.compiler" "prettyprint" } "alien.prettyprint" require-when
|
||||||
{ "boostrap.compiler" "debugger" } "alien.debugger" require-when
|
|
||||||
|
|
||||||
"cpu." cpu name>> append require
|
"cpu." cpu name>> append require
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue