Skip to content

Commit

Permalink
[MATLAB] Issue #66: Added %matlabcode support
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeandersson committed Feb 20, 2016
1 parent 34f58d4 commit b921b0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Lib/matlab/matlabuserdir.swg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
* Special user directives
* ------------------------------------------------------------------------- */

/* ------------------------------------------------------------------------- */

/* Inserting MATLAB code */
#define %matlabcode %insert("matlab")

/* ------------------------------------------------------------------------- */
/*
Implicit Conversion using the C++ constructor mechanism
Expand Down
4 changes: 3 additions & 1 deletion Source/Modules/matlab.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2609,7 +2609,9 @@ int MATLAB::insertDirective(Node *n) {
String *code = Getattr(n, "code");
String *section = Getattr(n, "section");

if (Cmp(section, "matlabsetup") == 0) {
if (Cmp(section, "matlab") == 0) {
Printv(f_wrap_m, code, NIL);
} else if (Cmp(section, "matlabsetup") == 0) {
Printv(f_setup_m, code, NIL);
} else {
Language::insertDirective(n);
Expand Down

0 comments on commit b921b0e

Please sign in to comment.