diff --git a/extra/alien/inline/inline-docs.factor b/extra/alien/inline/inline-docs.factor index 7f4bd510f4..260644e663 100644 --- a/extra/alien/inline/inline-docs.factor +++ b/extra/alien/inline/inline-docs.factor @@ -106,8 +106,6 @@ HELP: RAW-C: { $syntax "RAW-C:" "body" ";" } { $description "Insert a string into the generated source file. Useful for macros and other details not implemented in " { $snippet "alien.inline" } "." } ; -CONSTANT: foo "abc" - HELP: compile-c-library { $description "Writes, compiles, and links code generated since last invocation of " { $link POSTPONE: define-c-library } ". " "Also calls " { $snippet "add-library" } ". " @@ -206,6 +204,10 @@ HELP: with-c-library } { $description "Calls " { $link define-c-library } ", then the quotation, then " { $link compile-c-library } ", then sets all variables bound by " { $snippet "define-c-library" } " to " { $snippet "f" } "." } ; +HELP: raw-c +{ $values { "str" string } } +{ $description "Insert a string into the generated source file. Useful for macros and other details not implemented in " { $snippet "alien.inline" } "." } ; + ARTICLE: "alien.inline" "Inline C" { $vocab-link "alien.inline" } ; diff --git a/extra/alien/inline/inline.factor b/extra/alien/inline/inline.factor index 2514d30873..4582782c41 100644 --- a/extra/alien/inline/inline.factor +++ b/extra/alien/inline/inline.factor @@ -122,6 +122,9 @@ PRIVATE> [ [ define-c-library ] dip call compile-c-library ] [ cleanup-variables ] [ ] cleanup ; inline +: raw-c ( str -- ) + [ "\n" % % "\n" % ] "" make c-strings get push ; + SYNTAX: C-LIBRARY: scan define-c-library ; SYNTAX: COMPILE-AS-C++ t library-is-c++ set ; @@ -146,5 +149,4 @@ SYNTAX: ;C-LIBRARY compile-c-library ; SYNTAX: DELETE-C-LIBRARY: scan delete-inline-library ; -SYNTAX: RAW-C: - [ "\n" % parse-here % "\n" % c-strings get push ] "" make ; +SYNTAX: RAW-C: parse-here raw-c ;