mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:41:08 +01:00
Support for reading source code from stdin and other unusual places. (#3416)
- Treat an input of `-` as meaning stdin. - Fix building of an llvm::MemoryBuffer from a non-regular file. - Do not enforce filename restrictions on non-regular files. - Do not invent an output file name based on the name of a non-regular file. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
co-authored by
Chandler Carruth
parent
a204689893
commit
9154c6410e
@@ -131,7 +131,7 @@ auto Tree::PrintNode(llvm::raw_ostream& output, Node n, int depth,
|
||||
}
|
||||
|
||||
auto Tree::Print(llvm::raw_ostream& output) const -> void {
|
||||
output << "- filename: " << tokens_->filename() << "\n"
|
||||
output << "- filename: " << tokens_->source().filename() << "\n"
|
||||
<< " parse_tree: [\n";
|
||||
|
||||
// Walk the tree just to calculate depths for each node.
|
||||
@@ -166,7 +166,7 @@ auto Tree::Print(llvm::raw_ostream& output, bool preorder) const -> void {
|
||||
return;
|
||||
}
|
||||
|
||||
output << "- filename: " << tokens_->filename() << "\n"
|
||||
output << "- filename: " << tokens_->source().filename() << "\n"
|
||||
<< " parse_tree: [\n";
|
||||
|
||||
// The parse tree is stored in postorder. The preorder can be constructed
|
||||
|
||||
Reference in New Issue
Block a user