Advertisement
tinyevil

Untitled

Jun 21st, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. struct HTMLDocument{
  2. function FromSourceString(source:string):HTMLDocument{
  3. var doc:HTMLDocument = HTMLDocument{};
  4. doc.path = "unknown";
  5. doc.contents = ParseSource(source);
  6. return doc;
  7. }
  8.  
  9. function FromPath(path:string):HTMLDocument{
  10. var doc:HTMLDocument = HTMLDocument{};
  11. doc.path = path;
  12. doc.contents = ParseSource(ReadFile(path));
  13. return doc;
  14. }
  15. }
  16.  
  17.  
  18. function foo(obj:out HTMLDocument){
  19. *obj = HTMLDocument.FromSourceString("<html/>");
  20. var doc:HTMLDocument;
  21.  
  22. doc = HTMLDocument.FromPath("http://google.com");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement