Pol  Revision:3cfda13
compctx.h
Go to the documentation of this file.
1 
7 #ifndef BSCRIPT_COMPCTX_H
8 #define BSCRIPT_COMPCTX_H
9 
10 #include <iosfwd>
11 #include <string>
12 
13 #include <format/format.h>
14 
15 namespace Pol
16 {
17 namespace Bscript
18 {
26 {
27 public:
29  CompilerContext( const std::string& filename, int dbg_filenum, const char* s );
32 
33  void printOn( std::ostream& os ) const;
34  void printOn( fmt::Writer& writer ) const;
35  void printOnShort( std::ostream& os ) const;
36  void printOnShort( fmt::Writer& writer ) const;
37 
38  void skipws();
39  int skipcomments();
40 
45  const char* s;
46  int line;
47  std::string filename;
48 
49  const char* s_begin;
50 
52 };
53 
54 inline std::ostream& operator<<( std::ostream& os, const CompilerContext& ctx )
55 {
56  ctx.printOn( os );
57  return os;
58 }
59 
60 inline fmt::Writer& operator<<( fmt::Writer& writer, const CompilerContext& ctx )
61 {
62  ctx.printOn( writer );
63  return writer;
64 }
65 }
66 }
67 #endif
std::ostream & operator<<(std::ostream &os, const CompilerContext &ctx)
Definition: compctx.h:54
void printOn(std::ostream &os) const
Definition: compctx.cpp:162
CompilerContext & operator=(const CompilerContext &)
Definition: compctx.cpp:91
void printOnShort(std::ostream &os) const
Definition: compctx.cpp:172
Definition: berror.cpp:12