61 Commits

Author SHA1 Message Date
Philippe Canal
d03d24bb23 Add support for .@ to cancel continuation 2014-05-29 17:04:59 +02:00
Vassil Vassilev
d44612a63c Add a filename to the unnamed macro handling. Fixes ROOT-4760. 2014-05-21 12:44:57 +02:00
Vassil Vassilev
66faddd2db Style. 2014-05-20 10:40:57 +02:00
Vassil Vassilev
37f64ff956 Typo. 2014-05-19 16:27:54 +02:00
Vassil Vassilev
729d8da586 Inconsistently to named macros with return stmts we don't print the result of unnamed macros. 2014-05-19 16:05:57 +02:00
CristinaCristescu
bd47ead006 Multiple line of leading comments. (ROOT-5930 and ROOT-4791). 2014-04-23 15:47:55 +02:00
CristinaCristescu
d0a4c2c819 Unanamed macros not detecting leading and trailing comments. (ROOT-5930 and ROOT-4791). 2014-04-23 15:47:55 +02:00
Vassil Vassilev
d49c03b10c Files that are .x-ed must be unloadable too. Simplify. 2014-04-09 09:27:08 +02:00
Axel Naumann
93970e8c35 Replace StoredValueRef by Value. 2014-04-01 18:31:58 +02:00
Axel Naumann
9b678f2829 Allow updating of the MetaProcessor's output stream, to redirect a meta command. 2014-02-25 14:18:01 +01:00
Bertrand Bellenot
b9838091fd Fix compilation on Windows 2014-02-03 14:08:56 +01:00
CristinaCristescu
383911dc6a Tab completion, stacked redirection, unredirect to pipe, platform independence.
Tab completion works using the changed (but ROOT 5 compatible) syntax .> A.txt.
.> now uses dup2() that exists on Windows, too, instead of ttyname().
Tnis enables unredirection even during root > out.txt - which did not work in ROOT5.
Multiple ".> X.txt" can be stacked; ".>" unredirects back to the previous one on the stack.
2014-01-24 16:36:59 +01:00
CristinaCristescu
1465ec4d8a Warning and error fix.
(cherry picked from commit 9eb5a29d7c6d6430fb70a76f19b9a0e6d259da62)
2014-01-15 17:10:54 +01:00
CristinaCristescu
b2997ee67a Adjust to line size limit. 2014-01-15 16:43:57 +01:00
Axel Naumann
f9b047d85f Use the portable FILE. 2014-01-15 14:14:55 +01:00
CristinaCristescu
b3ba3f5804 Redirect changes touse SmallString. 2014-01-15 12:02:04 +01:00
CristinaCristescu
c9ec997188 Redirection special 2>&1 case. 2014-01-15 12:02:04 +01:00
CristinaCristescu
6296b84ab3 Changes to redirection. 2014-01-15 12:02:03 +01:00
CristinaCristescu
0ec0ba48b6 Change redirection from Interpreter to MetaProcessor. 2014-01-15 12:02:03 +01:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Philippe Canal
bf982c59e4 Avoid reading past the end of a static buffer.
llvm::sys::fs::identify_magic takes a StringRef which
was automatically created from a the char[1024] buffer.
To create the StringRef automatically requires a call to
strlen but in this case the buffer is by definition not
null terminated.  We could either null terminate or better
yet just construct explicit the 'right' StringRef.
2013-11-21 18:11:02 +01:00
Axel Naumann
8542f73128 Fix include. 2013-09-26 17:54:18 +02:00
Axel Naumann
1c8d0e6378 File magic moved / changed. 2013-09-26 17:54:18 +02:00
Axel Naumann
11e71f5c76 Make result evaluation optional again. 2013-06-10 17:12:50 +02:00
Axel Naumann
0c1c22f002 Return action result and Value from all interfaces. Force callers to rpovide them, to make them handle errors etc. 2013-06-07 15:19:51 +02:00
Axel Naumann
fb8620de4c Error out of the input file is incomplete (ROOT-4823) 2013-05-17 17:21:55 +02:00
Vassil Vassilev
1ae610b211 Fix savannah #99234.
The issue we experienced is that we couldn't pipe the output in the terminal.
The reason is that we were using llvm::outs() which closes explicitly the file
descriptor (thanks Axel for the help debugging).
We introduce our custom stream, which keeps the file descriptor open so that
we can use it in pipes. For debugging purposes, however we use/should use llvm::errs()

The lesson learned:
DONT USE LLVM::OUTS() ANYMORE!


git-svn-id: http://root.cern.ch/svn/root/trunk@48316 27541ba8-7e3a-0410-8455-c3a389f83636
2013-01-17 15:27:14 +00:00
Philippe Canal
5e19abebbb humm .. the message was not so much the problem but rather the 'unbalanced' fixing. Yet another minor patch around the current unnamed script detection to make it go a bit further ...
git-svn-id: http://root.cern.ch/svn/root/trunk@47938 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-09 10:07:41 +00:00
Philippe Canal
6a56db4741 Disable error/warning message that is often wrongly issued (whenever an unamed macro has text after the closing })
git-svn-id: http://root.cern.ch/svn/root/trunk@47936 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-09 06:44:59 +00:00
Vassil Vassilev
20f9431b19 Use the stored value in MP;
Invoke process instead of it's shortcuts. Should fix savannah #98725


git-svn-id: http://root.cern.ch/svn/root/trunk@47916 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-07 13:04:19 +00:00
Vassil Vassilev
9881b59a06 Get rid of meta processor options and various improvements.
git-svn-id: http://root.cern.ch/svn/root/trunk@47889 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 11:47:24 +00:00
Vassil Vassilev
5fe903da79 Don't rely on MP options we have support for rawInput in the interpreter through cling::Interpreter::process
git-svn-id: http://root.cern.ch/svn/root/trunk@47883 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:40:20 +00:00
Vassil Vassilev
9b237493fe MetaProcessor Options must go away. This is one step towards it.
git-svn-id: http://root.cern.ch/svn/root/trunk@47879 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:18:35 +00:00
Vassil Vassilev
7717eb911f Cleanup.
git-svn-id: http://root.cern.ch/svn/root/trunk@47878 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:15:38 +00:00
Vassil Vassilev
1f8fc62305 Remove unused code
git-svn-id: http://root.cern.ch/svn/root/trunk@47877 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-06 10:11:25 +00:00
Axel Naumann
5ed01c266c Add interface to cancel input continuation.
git-svn-id: http://root.cern.ch/svn/root/trunk@47803 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-04 08:05:33 +00:00
Vassil Vassilev
60b330abb2 Revert r47746 (which means fully unrevert the r47739). We can run roottest and all seems good. Unbreaks the trunk.
git-svn-id: http://root.cern.ch/svn/root/trunk@47752 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-01 00:45:43 +00:00
Philippe Canal
e719c8efdb Partially revert r47739 so that we have a functional meta processor
git-svn-id: http://root.cern.ch/svn/root/trunk@47746 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-30 23:09:26 +00:00
Vassil Vassilev
72539ff673 Implement lexer/parser/sema for the meta language, which we have to implement soon.
* It makes the life easier to add new grammar rules and keywords.
* Silences a lot of the test failures we had.
* Fixes the imbalanced ' or " properly.


git-svn-id: http://root.cern.ch/svn/root/trunk@47739 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-30 17:26:26 +00:00
Timur Pocheptsov
208c024a5d 1. Remove <iostream>.
2. '_' can also be a part of identifier.


git-svn-id: http://root.cern.ch/svn/root/trunk@47686 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-28 19:37:36 +00:00
Timur Pocheptsov
4e1cc75fda Remove TCintDisplayClass from the core/meta, fix MetaProcessor.cpp (wrong include path)
git-svn-id: http://root.cern.ch/svn/root/trunk@47677 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-28 16:50:13 +00:00
Timur Pocheptsov
f474053b85 1. Remove all ROOT specific code from the TCintDisplayXXX and move this "display" into the MetaProcessor.
2. Mods in CommandLexer to support .! .g .class in a MetaProcessor.


git-svn-id: http://root.cern.ch/svn/root/trunk@47674 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-28 16:38:02 +00:00
Vassil Vassilev
b66d4750fd Handle properly ticks and quotes.
I know that the lexers are getting too many and soon I will merge both implementations
into one full-blown.
Reduces the test failures a lot.


git-svn-id: http://root.cern.ch/svn/root/trunk@47652 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-27 15:41:08 +00:00
Axel Naumann
010b391174 Warning comparison (un)signed.
git-svn-id: http://root.cern.ch/svn/root/trunk@47526 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-21 10:51:41 +00:00
Axel Naumann
a68395dc86 Also set the name of the currently executing file for readInputFromFile.
Refuse to readInputFromFile if the file is binary, as determined by llvm::sys::IdentifyFileType or wild guessing based on the fraction of non-printables in the first 1k (max) bytes.
Prevents root -l libRooFit.so
Now that we identify the file we could even link the library in - but that's for later.


git-svn-id: http://root.cern.ch/svn/root/trunk@47500 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 20:21:29 +00:00
Axel Naumann
546c2b1e61 When parsing .x/.L filename() //comment
* empty argument is not an error.
* pass comment to interpreter whether .x was successful or not; it might be an expected-diagnostic
Thus implement comment lexer.


git-svn-id: http://root.cern.ch/svn/root/trunk@47473 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 13:15:25 +00:00
Axel Naumann
83f7b6c23d Say who is complaining.
git-svn-id: http://root.cern.ch/svn/root/trunk@47470 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-20 10:10:57 +00:00
Axel Naumann
26f3d7cf75 Do cling's best at returning the currently executing file.
#included files will not be picked up as cling cannot tell where the currently running function was defined.
But it does know which file was passed to MetaProcessor::executeFunction() (e.g. via .x).
So at least store that.
This fixes the occurrences of GetCurrentMacroName() in tutorials/


git-svn-id: http://root.cern.ch/svn/root/trunk@47421 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-19 00:00:53 +00:00
Axel Naumann
a5ab389c14 These meta commands request a dump of the current file*s*: use plural.
git-svn-id: http://root.cern.ch/svn/root/trunk@47334 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 19:59:26 +00:00
Axel Naumann
226b360b15 Rename LoadLibResult constants to start with 'k'.
Enable kLoadLibExists case in TCintWithCling.

Collect statistics about loaded files.
Give access to that through .file; rename SourceManager dump to fileEx.

Documentation.

(Sorry, should have been three patches.)


git-svn-id: http://root.cern.ch/svn/root/trunk@47330 27541ba8-7e3a-0410-8455-c3a389f83636
2012-11-15 18:23:11 +00:00