Permalink
Browse files

NORMAL added support for cached REQUIRE operations and a monadic pars…

…er combinator library.
  • Loading branch information...
VincentToups committed May 22, 2012
1 parent 72cb881 commit ee9e8f82959654b7ef1b1342b7623058a852f537
View
@@ -9,9 +9,9 @@
;
c1 = flatAcross(c1);
c2 = flatAcross(c2);
-forLoopValueminus77711 = flatAcross(c1);
-for i = ((1):(length(forLoopValueminus77711)))
- c1El = forLoopValueminus77711(i);
+forLoopValueminus111164 = flatAcross(c1);
+for i = ((1):(length(forLoopValueminus111164)))
+ c1El = forLoopValueminus111164(i);
c1El = c1El{1};
c2El = c2{i};
if ~(equal(c1El, c2El))
@@ -22,7 +22,7 @@
end
;
end
-clear 'forLoopValueminus77711';
+clear 'forLoopValueminus111164';
;
r = 1;
View
@@ -0,0 +1,14 @@
+function [ignore] = deletemtimes(file, varargin)
+%Just like DELETE* except deletes multiple files and returns a value.
+ignore = 0;
+delete(file);
+forLoopValueminus111170 = flatAcross(varargin);
+for i = ((1):(length(forLoopValueminus111170)))
+ v = forLoopValueminus111170(i);
+ v = v{1};
+ delete(v);
+end
+clear 'forLoopValueminus111170';
+;
+
+end
View
@@ -9,7 +9,7 @@
end
;
if ~(exist('postFilter'))
- postFilter = @lambdaminus77706;
+ postFilter = @lambdaminus111159;
else
[];
end
@@ -21,9 +21,9 @@
files{plus(end, 1)} = name;
end
;
-function [retvalminus77707] = lambdaminus77706(x)
+function [retvalminus111160] = lambdaminus111159(x)
%
-retvalminus77707 = 1;
+retvalminus111160 = 1;
end
View
@@ -9,7 +9,7 @@
end
;
if ~(exist('postFilter'))
- postFilter = @lambdaminus77704;
+ postFilter = @lambdaminus111157;
else
[];
end
@@ -26,9 +26,9 @@
;
end
;
-function [retvalminus77705] = lambdaminus77704(x)
+function [retvalminus111158] = lambdaminus111157(x)
%
-retvalminus77705 = 1;
+retvalminus111158 = 1;
end
View
@@ -9,7 +9,7 @@
end
;
if ~(exist('postFilter'))
- postFilter = @lambdaminus77702;
+ postFilter = @lambdaminus111155;
else
[];
end
@@ -26,9 +26,9 @@
;
end
;
-function [retvalminus77703] = lambdaminus77702(x)
+function [retvalminus111156] = lambdaminus111155(x)
%
-retvalminus77703 = 1;
+retvalminus111156 = 1;
end
View
@@ -1,9 +1,9 @@
function [b] = equalOneOf(value, values)
%
b = 0;
-forLoopValueminus77714 = flatAcross(values);
-for i = ((1):(length(forLoopValueminus77714)))
- valuemtimes = forLoopValueminus77714(i);
+forLoopValueminus111167 = flatAcross(values);
+for i = ((1):(length(forLoopValueminus111167)))
+ valuemtimes = forLoopValueminus111167(i);
valuemtimes = valuemtimes{1};
if equal(value, valuemtimes)
b = 1;
@@ -13,7 +13,7 @@
end
;
end
-clear 'forLoopValueminus77714';
+clear 'forLoopValueminus111167';
;
end
View
@@ -1,9 +1,9 @@
function [result] = equaldigit(input)
%Parser one character from the set 0-9.
-result = funcall(pbind(@equalitem, @lambdaminus77724), input);
-function [retvalminus77725] = lambdaminus77724(i)
+result = funcall(pbind(@equalitem, @lambdaminus108380), input);
+function [retvalminus108381] = lambdaminus108380(i)
%
-retvalminus77725 = fif(~(isempty(strfind('0123456789', i))), @()preturn(i), @()@equalnil);
+retvalminus108381 = fif(~(isempty(strfind('0123456789', i))), @()preturn(i), @()@equalnil);
end
View
@@ -1,9 +1,9 @@
function [oparser] = equalgreaterThanitems(n)
%Return a parser which returns N items from the input.
-oparser = @lambdaminus77720;
-function [retvalminus77721] = lambdaminus77720(input)
+oparser = @lambdaminus108376;
+function [retvalminus108377] = lambdaminus108376(input)
%
-retvalminus77721 = fif(lessThanequal(n, length(input)), @()cellArray(input(((1):(n))), input(((plus(n, 1)):(end)))), @()cellArray());
+retvalminus108377 = fif(lessThanequal(n, length(input)), @()cellArray(input(((1):(n))), input(((plus(n, 1)):(end)))), @()cellArray());
end
View
@@ -1,13 +1,13 @@
function [r] = equalgreaterThanmaybe(equalp)
%Return a parser that parses =p, and if that fails succeeds anyway,
%returning an empty value.
-r = @lambdaminus77728;
-function [retvalminus77729] = lambdaminus77728(input)
+r = @lambdaminus108384;
+function [retvalminus108385] = lambdaminus108384(input)
%
-retvalminus77729 = funcall(@lambdaminus77730, funcall(equalp, input));
-function [retvalminus77731] = lambdaminus77730(r1)
+retvalminus108385 = funcall(@lambdaminus108386, funcall(equalp, input));
+function [retvalminus108387] = lambdaminus108386(r1)
%
-retvalminus77731 = fif(~(isempty(r1)), @()r1, @()cellArray([], input));
+retvalminus108387 = fif(~(isempty(r1)), @()r1, @()cellArray([], input));
end
View
@@ -1,10 +1,10 @@
function [equalp] = equalgreaterThannumber(n)
%Return a parser which succeeds only when it can parse a number from
%the input and that number is N, numerically.
-equalp = pbind(@equalnumber, @lambdaminus77726);
-function [retvalminus77727] = lambdaminus77726(m)
+equalp = pbind(@equalnumber, @lambdaminus108382);
+function [retvalminus108383] = lambdaminus108382(m)
%
-retvalminus77727 = fif(equalequal(n, m), @()preturn(n), @()@equalnil);
+retvalminus108383 = fif(equalequal(n, m), @()preturn(n), @()@equalnil);
end
View
@@ -1,9 +1,9 @@
function [oparser] = equalgreaterThanstring(s)
%Return a parser which matches the string S only.
-oparser = pbind(equalgreaterThanitems(length(s)), @lambdaminus77722);
-function [retvalminus77723] = lambdaminus77722(subString)
+oparser = pbind(equalgreaterThanitems(length(s)), @lambdaminus108378);
+function [retvalminus108379] = lambdaminus108378(subString)
%
-retvalminus77723 = fif(strcmp(subString, s), @()preturn(s), @()@equalnil);
+retvalminus108379 = fif(strcmp(subString, s), @()preturn(s), @()@equalnil);
end
View
@@ -1,16 +1,16 @@
function [r] = equallistOfSexpressions(input)
%
-p = pbind(@equalopenParen, @lambdaminus77746);
+p = pbind(@equalopenParen, @lambdaminus108402);
r = p(input);
-function [retvalminus77747] = lambdaminus77746(ignore)
+function [retvalminus108403] = lambdaminus108402(ignore)
%
-retvalminus77747 = pbind(equalgreaterThanzeroOrMore(@equalsexpressionplusspaces), @lambdaminus77748);
-function [retvalminus77749] = lambdaminus77748(contents)
+retvalminus108403 = pbind(equalgreaterThanzeroOrMore(@equalsexpressionplusspaces), @lambdaminus108404);
+function [retvalminus108405] = lambdaminus108404(contents)
%
-retvalminus77749 = pbind(@equalcloseParen, @lambdaminus77750);
-function [retvalminus77751] = lambdaminus77750(ignore)
+retvalminus108405 = pbind(@equalcloseParen, @lambdaminus108406);
+function [retvalminus108407] = lambdaminus108406(ignore)
%
-retvalminus77751 = preturn(contents);
+retvalminus108407 = preturn(contents);
end
View
@@ -1,13 +1,13 @@
function [r] = equalquotedSexpression(input)
%
-p = pbind(equalgreaterThanstring(''''), @lambdaminus77732);
+p = pbind(equalgreaterThanstring(''''), @lambdaminus108388);
r = funcall(p, input);
-function [retvalminus77733] = lambdaminus77732(ignore)
+function [retvalminus108389] = lambdaminus108388(ignore)
%
-retvalminus77733 = pbind(@equalsexpression, @lambdaminus77734);
-function [retvalminus77735] = lambdaminus77734(theSexpression)
+retvalminus108389 = pbind(@equalsexpression, @lambdaminus108390);
+function [retvalminus108391] = lambdaminus108390(theSexpression)
%
-retvalminus77735 = preturn(cellArray(makeSymbol('quote'), theSexpression));
+retvalminus108391 = preturn(cellArray(makeSymbol('quote'), theSexpression));
end
@@ -1,16 +1,16 @@
function [r] = equalsexpressionplusspaces(input)
%Parse an s-expression with spaces around it.
-p = pbind(equalgreaterThanmaybe(@equalspaces), @lambdaminus77740);
+p = pbind(equalgreaterThanmaybe(@equalspaces), @lambdaminus108396);
r = p(input);
-function [retvalminus77741] = lambdaminus77740(ignore)
+function [retvalminus108397] = lambdaminus108396(ignore)
%
-retvalminus77741 = pbind(@equalsexpression, @lambdaminus77742);
-function [retvalminus77743] = lambdaminus77742(e)
+retvalminus108397 = pbind(@equalsexpression, @lambdaminus108398);
+function [retvalminus108399] = lambdaminus108398(e)
%
-retvalminus77743 = pbind(equalgreaterThanmaybe(@equalspaces), @lambdaminus77744);
-function [retvalminus77745] = lambdaminus77744(ignore)
+retvalminus108399 = pbind(equalgreaterThanmaybe(@equalspaces), @lambdaminus108400);
+function [retvalminus108401] = lambdaminus108400(ignore)
%
-retvalminus77745 = preturn(e);
+retvalminus108401 = preturn(e);
end
@@ -1,13 +1,13 @@
function [r] = equalsharpQuotedSexpression(input)
%
-p = pbind(equalgreaterThanstring('#'''), @lambdaminus77736);
+p = pbind(equalgreaterThanstring('#'''), @lambdaminus108392);
r = funcall(p, input);
-function [retvalminus77737] = lambdaminus77736(ignore)
+function [retvalminus108393] = lambdaminus108392(ignore)
%
-retvalminus77737 = pbind(@equalsexpression, @lambdaminus77738);
-function [retvalminus77739] = lambdaminus77738(theSexpression)
+retvalminus108393 = pbind(@equalsexpression, @lambdaminus108394);
+function [retvalminus108395] = lambdaminus108394(theSexpression)
%
-retvalminus77739 = preturn(cellArray(makeSymbol('function'), theSexpression));
+retvalminus108395 = preturn(cellArray(makeSymbol('function'), theSexpression));
end
@@ -1,16 +1,16 @@
function [r] = equalvectorOfSexpressions(input)
%Parse a vector of s-expressions.
-p = pbind(@equalopenSquare, @lambdaminus77752);
+p = pbind(@equalopenSquare, @lambdaminus108408);
r = p(input);
-function [retvalminus77753] = lambdaminus77752(ignore)
+function [retvalminus108409] = lambdaminus108408(ignore)
%
-retvalminus77753 = pbind(equalgreaterThanzeroOrMore(@equalsexpressionplusspaces), @lambdaminus77754);
-function [retvalminus77755] = lambdaminus77754(contents)
+retvalminus108409 = pbind(equalgreaterThanzeroOrMore(@equalsexpressionplusspaces), @lambdaminus108410);
+function [retvalminus108411] = lambdaminus108410(contents)
%
-retvalminus77755 = pbind(@equalcloseSqare, @lambdaminus77756);
-function [retvalminus77757] = lambdaminus77756(ignore)
+retvalminus108411 = pbind(@equalcloseSqare, @lambdaminus108412);
+function [retvalminus108413] = lambdaminus108412(ignore)
%
-retvalminus77757 = preturn([ cellArray(makeSymbol('vector')) contents ]);
+retvalminus108413 = preturn([ cellArray(makeSymbol('vector')) contents ]);
end
View
@@ -2,9 +2,9 @@
%Return the directory part of a file.
ii = find(equalequal(wholeFile, '/'));
if isempty(ii)
- name = wholeFile;
+ theDir = wholeFile;
else
- name = wholeFile(((1):(minus(ii(end), 1))));
+ theDir = wholeFile(((1):(minus(ii(end), 1))));
end
;
@@ -0,0 +1,44 @@
+modsign;
+transcoded;
+script;
+:;
+tildadivideelispdivideutilsdivideparenlabdividemonadicParserCombinators.parenlabmodsign;
+transcoded;
+script;
+:;
+tildadivideelispdivideutilsdivideparenlabdividemonadicParserCombinators.parenlab;
+;
+@pbind;
+@preturn;
+@equalitem;
+@equalgreaterThanitems;
+@equalgreaterThanstring;
+@equalnil;
+@equaldigit;
+@equalnumber;
+@equalgreaterThannumber;
+@equalnumberPhStyle;
+@equalspace;
+@equalspaces;
+@equalgreaterThanmaybe;
+@equalgreaterThanor;
+@equalgreaterThanzeroOrMore;
+@equal_;
+@equalsymbol;
+@equalkeyword;
+@equalsexpression;
+@equalquotedSexpression;
+@equalsharpQuotedSexpression;
+@equalsexpressionplusspaces;
+@equalopenParen;
+@equalcloseParen;
+@equalopenSquare;
+@equalcloseSquare;
+@makeSymbol;
+@makeKeyword;
+@symbolp;
+@keywordp;
+@equallistOfSexpressions;
+@equalvectorOfSexpressions;
+@equallispString;
+[];
@@ -1,6 +1,4 @@
-(addpath "~/elisp/utils/parenlab/")
-
-(defmacro parser (bindings &rest body)
+% transcoded script : ~/elisp/utils/parenlab/monadic-parser-combinators.parenlab% transcoded script : ~/elisp/utils/parenlab/monadic-parser-combinators.parenlab(defmacro parser (bindings &rest body)
"A parser monad macro. Each BINDING expression is a symbol/parser
expression pair. The symbol is bound to the proper return value of
the parser at parse time."
@@ -304,6 +302,7 @@ successfully parsed results is returned."
(:otherwise
(setq r (cell-array)))))
+
(dont-do
(first (=lisp-string "\"te\\\"st\""))
(first (=symbol "3some-symbol dogs"))
View
@@ -44,18 +44,6 @@
(comint-send-strings (get-buffer pla:matlab-buffer)
(pl:mangle (replace-string-in-string ".parenlab" "" (buffer-name))))))
-;; (defun parenlab-do-last-sexp ()
-;; (interactive "")
-;; (save-excursion
-;; (let* ((code (get-last-sexp))
-;; (code `(emessage (echo-return (evalc ',code)))))
-;; ;; Note that the above code uses my personal matlab function
-;; ;; emessage which sends a message to emacs from matlab, it is
-;; ;; not included with this library.
-;; (let ((pl:disable-indentation :outer))
-;; (comint-send-strings (get-buffer pla:matlab-buffer)
-;; (pl:replace-newlines-with-semicolons
-;; (pl:transcode-to-string code)))))))
(pl:def-pl-macro with-error-to-emacs (&rest body)
(let ((error-name (gensym "error-name-")))
Oops, something went wrong.

0 comments on commit ee9e8f8

Please sign in to comment.