Skip to content

Commit

Permalink
Simplify native reading (#54)
Browse files Browse the repository at this point in the history
* Simplify native reading

Simplify the operations of reading and tokenizing an input source file that is either Boot or Spad.

* Fix thinko

* Use `std::numeric_limits` to express intent
  • Loading branch information
GabrielDosReis authored Jul 25, 2024
1 parent 285a70c commit d4f5a4b
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 60 deletions.
12 changes: 11 additions & 1 deletion src/include/open-axiom/InputFragment
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// -*- C++ -*-
// Copyright (C) 2014-2015, Gabriel Dos Reis.
// Copyright (C) 2014-2024, Gabriel Dos Reis.
// All rights reserved.
// Written by Gabriel Dos Reis.
//
Expand Down Expand Up @@ -127,6 +127,16 @@ namespace OpenAxiom {
};

std::ostream& operator<<(std::ostream&, const Fragment&);

// A prose is the contents of an input source file organized as a
// sequence of fragments.
// Note: a prose is defined as movable, but not a copyable type.
struct Prose : std::vector<Fragment> {
Prose() = default;
Prose(Prose&&) = default;
};

Prose read_source(std::istream&);
}

#endif // OPENAXIOM_INPUTFRAGMENT_included
Loading

0 comments on commit d4f5a4b

Please sign in to comment.