ArkScript
A small, fast, functional and scripting language for video games
Ark::internal::Import Struct Reference

#include <Import.hpp>

Collaboration diagram for Ark::internal::Import:
[legend]

Public Member Functions

std::string toPackageString () const
 
std::string packageToPath () const
 
bool isBasic () const
 Check if we should import everything with a prefix, given a (import foo.bar.egg)
 

Public Attributes

std::size_t line
 
std::size_t col
 Position in the source file.
 
std::string prefix
 The filename without the extension.
 
std::vector< std::string > package
 Package with all the segments.
 
bool with_prefix = true
 Import with prefix (import package)
 
bool is_glob = false
 Import as glob (import package:*)
 
std::vector< std::string > symbols
 List of symbols to import, can be empty if none provided. (import package :a :b)
 

Detailed Description

Definition at line 12 of file Import.hpp.

Member Function Documentation

◆ isBasic()

bool Ark::internal::Import::isBasic ( ) const
inlinenodiscard

Check if we should import everything with a prefix, given a (import foo.bar.egg)

Returns
true
false

Definition at line 82 of file Import.hpp.

◆ packageToPath()

std::string Ark::internal::Import::packageToPath ( ) const
inlinenodiscard
Returns
a package as a path, eg a/b/c

Definition at line 65 of file Import.hpp.

◆ toPackageString()

std::string Ark::internal::Import::toPackageString ( ) const
inlinenodiscard
Returns
a package string, eg a.b.c

Definition at line 54 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().

Member Data Documentation

◆ col

std::size_t Ark::internal::Import::col

Position in the source file.

Definition at line 14 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().

◆ is_glob

bool Ark::internal::Import::is_glob = false

Import as glob (import package:*)

Definition at line 42 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().

◆ line

std::size_t Ark::internal::Import::line

Definition at line 14 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().

◆ package

std::vector<std::string> Ark::internal::Import::package

Package with all the segments.

Example: (import foo.bar) => {foo, bar} (import foo.bar.egg:*) => {foo, bar, egg} (import foo :a :b :c) => {foo}

Definition at line 31 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().

◆ prefix

std::string Ark::internal::Import::prefix

The filename without the extension.

Example: (import foo.bar) => bar (import foo.bar.egg:*) => egg (import foo :a :b :c) => foo

Definition at line 23 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().

◆ symbols

std::vector<std::string> Ark::internal::Import::symbols

List of symbols to import, can be empty if none provided. (import package :a :b)

Definition at line 48 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().

◆ with_prefix

bool Ark::internal::Import::with_prefix = true

Import with prefix (import package)

Definition at line 37 of file Import.hpp.

Referenced by Ark::internal::Parser::import_().


The documentation for this struct was generated from the following file: