GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lpython/src/lpython/python_serialization.cpp at main · lcompilers/lpython

Expand file tree

/

python_serialization.cpp

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
48 lines (39 loc) · 1.04 KB
/

python_serialization.cpp

Copy path

File metadata and controls

48 lines (39 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <string>
#include <libasr/config.h>
#include <lpython/python_serialization.h>
#include <libasr/bwriter.h>
#include <libasr/string_utils.h>
namespace LCompilers::LPython {
class ASTDeserializationVisitor :
#ifdef WITH_LFORTRAN_BINARY_MODFILES
public BinaryReader,
#else
public TextReader,
#endif
public AST::DeserializationBaseVisitor<ASTDeserializationVisitor>
{
public:
ASTDeserializationVisitor(Allocator &al, const std::string &s) :
#ifdef WITH_LFORTRAN_BINARY_MODFILES
BinaryReader(s),
#else
TextReader(s),
#endif
DeserializationBaseVisitor(al, true, 0) {}
bool read_bool() {
uint8_t b = read_int8();
return (b == 1);
}
char* read_cstring() {
std::string s = read_string();
LCompilers::Str cs;
cs.from_str_view(s);
char* p = cs.c_str(al);
return p;
}
};
AST::ast_t* deserialize_ast(Allocator &al, const std::string &s) {
ASTDeserializationVisitor v(al, s);
return v.deserialize_node();
}
} // namespace LCompilers::LPython
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.