mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 17:15:45 +00:00
Add references to runtime
This commit is contained in:
@@ -66,6 +66,8 @@ jobs:
|
|||||||
crosslang upload-package --token="$CPKG_KEY" --host="https://cpkg.tesseslanguage.com/"
|
crosslang upload-package --token="$CPKG_KEY" --host="https://cpkg.tesseslanguage.com/"
|
||||||
cd ../Tesses.CrossLang.Std
|
cd ../Tesses.CrossLang.Std
|
||||||
crosslang upload-package --token="$CPKG_KEY" --host="https://cpkg.tesseslanguage.com/"
|
crosslang upload-package --token="$CPKG_KEY" --host="https://cpkg.tesseslanguage.com/"
|
||||||
|
cd ../Tesses.CrossLang.Reference
|
||||||
|
crosslang upload-package --token="$CPKG_KEY" --host="https://cpkg.tesseslanguage.com/"
|
||||||
cd ../Templates/compiletool
|
cd ../Templates/compiletool
|
||||||
crosslang upload-package --token="$CPKG_KEY" --host="https://cpkg.tesseslanguage.com/"
|
crosslang upload-package --token="$CPKG_KEY" --host="https://cpkg.tesseslanguage.com/"
|
||||||
cd ../console
|
cd ../console
|
||||||
|
|||||||
84
Tesses.CrossLang.Reference/src/runtime_methods/class.tcross
Normal file
84
Tesses.CrossLang.Reference/src/runtime_methods/class.tcross
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
/^ Get the class info returns ClassInfo^/
|
||||||
|
func Class.GetInfo(classInstanceOrClassName)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get the names of all the loaded classes on root environment ^/
|
||||||
|
func Class.GetClassNames()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Create instance of class (supports both name and list of name parts split on '.') ^/
|
||||||
|
func Class.CreateInstance(name, args)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get the name of the class instance ^/
|
||||||
|
func Class.Name(instance)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get the instance specific info, including current values, returns ClassInstanceInfo ^/
|
||||||
|
func Class.GetInstanceInfo(instance)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ Schema for what Class.GetInfo returns ^/
|
||||||
|
class ClassInfo : Dictionary {
|
||||||
|
/^ The class name ^/
|
||||||
|
public Name;
|
||||||
|
/^ The class name parts (List of strings split on '.') ^/
|
||||||
|
public NameParts;
|
||||||
|
/^ The base class name ^/
|
||||||
|
public Inherits;
|
||||||
|
|
||||||
|
/^ The base class name parts (List of strings split on '.') ^/
|
||||||
|
public InheritsParts;
|
||||||
|
/^ Documentation of class ^/
|
||||||
|
public Documentation;
|
||||||
|
/^ List of methods and fields in class with (schema is ClassInfoEntry)^/
|
||||||
|
public Entries;
|
||||||
|
}
|
||||||
|
/^ The schema of the items in the list Entries in the dictionary that Class.GetInfo returns ^/
|
||||||
|
class ClassInfoEntry : Dictionary {
|
||||||
|
/^ Field or method name ^/
|
||||||
|
public Name;
|
||||||
|
/^ Is the method abstract (or is the field unset) ^/
|
||||||
|
public IsAbstract;
|
||||||
|
/^ Is the entry a method (true) or field (false) ^/
|
||||||
|
public IsFunction;
|
||||||
|
/^ Documentation for entry ^/
|
||||||
|
public Documentation;
|
||||||
|
/^ Chunk id for entry if any ^/
|
||||||
|
public ChunkId;
|
||||||
|
/^ Arguments of entry if any (always a list)^/
|
||||||
|
public Arguments;
|
||||||
|
/^ Modifier (can be public, protected, private or static ) ^/
|
||||||
|
public Modifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ Schema for what Class.GetInstanceInfo returns ^/
|
||||||
|
class ClassInstanceInfo : Dictionary {
|
||||||
|
/^ The class name ^/
|
||||||
|
public Name;
|
||||||
|
/^ The file that the class is from ^/
|
||||||
|
public File;
|
||||||
|
/^ List of all classes this class inherits from (tree) ^/
|
||||||
|
public InheritList;
|
||||||
|
|
||||||
|
/^ List of methods and fields in class with (schema is ClassInstanceInfoEntry)^/
|
||||||
|
public Entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ The schema of the items in the list Entries in the dictionary that Class.GetInstanceInfo returns ^/
|
||||||
|
class ClassInstanceInfoEntry : Dictionary {
|
||||||
|
/^ Field or method name ^/
|
||||||
|
public Name;
|
||||||
|
/^ Is the entry a method (true) or field (false) ^/
|
||||||
|
public IsFunction;
|
||||||
|
/^ Owner for entry (the class that owns it)^/
|
||||||
|
public Owner;
|
||||||
|
/^ The current value of the entry ^/
|
||||||
|
public Value;
|
||||||
|
}
|
||||||
@@ -1,5 +1,83 @@
|
|||||||
/^ Write Text To Standard Output ^/
|
/^ Get whether terminal is echoing characters read ^/
|
||||||
func Console.WriteLine(text)
|
func Console.getEcho()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Set whether terminal is echoing characters read ^/
|
||||||
|
func Console.setEcho(flag)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get whether terminal is buffering line by line (true) or byte by byte (false) ^/
|
||||||
|
func Console.getCanonical()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Set whether terminal is buffering line by line (true) or byte by byte (false) ^/
|
||||||
|
func Console.setCanonical(flag)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get whether terminal is sending signals for CTRL+C (true) or via read (false) ^/
|
||||||
|
func Console.getSignals()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Set whether terminal is sending signals for CTRL+C (true) or via read (false) ^/
|
||||||
|
func Console.setSignals(flag)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/^ Write Text To Standard Output ^/
|
||||||
|
func Console.Write(text)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Write Text To Standard Output with newline ^/
|
||||||
|
func Console.WriteLine($text)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Write Text To Standard Error ^/
|
||||||
|
func Console.Error(text)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Write Text To Standard Error with newline ^/
|
||||||
|
func Console.ErrorLine($text)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Read a byte from stdin ^/
|
||||||
|
func Console.Read()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Read a line from stdin ^/
|
||||||
|
func Console.ReadLine()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Fatally stop program (only allowed if you have full permissions) with optional message ^/
|
||||||
|
func Console.Fatal($error_message)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get stdin Stream ^/
|
||||||
|
func Console.getIn()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get stdout Stream ^/
|
||||||
|
func Console.getOut()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get stderr Stream ^/
|
||||||
|
func Console.getError()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
30
Tesses.CrossLang.Reference/src/runtime_methods/crypto.tcross
Normal file
30
Tesses.CrossLang.Reference/src/runtime_methods/crypto.tcross
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/^ Create bytearray but with secure random bytes in it instead of zeros ^/
|
||||||
|
func Crypto.RandomBytes(byteCount, personalString)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^
|
||||||
|
Hash passwords with PBKDF2
|
||||||
|
shanum:
|
||||||
|
1: sha1 (please don't)
|
||||||
|
224: sha224 (please use this)
|
||||||
|
256: sha256 (vunerable to length extension attack)
|
||||||
|
384: sha384 (perferably this)
|
||||||
|
512: sha512 (vunerable to length extension attack)
|
||||||
|
|
||||||
|
^/
|
||||||
|
func Crypto.PBKDF2(pass,salt,itterations,keylen,shanum)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Base64 Encode ^/
|
||||||
|
func Crypto.Base64Encode(bytes)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ Base64 Decode ^/
|
||||||
|
func Crypto.Base64Decode(str)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/^ Returns DictionaryEnumerator ^/
|
||||||
|
func Dictionary.Items(dictordyndict)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Set field in dictionary ^/
|
||||||
|
func Dictionary.SetField(dict, key, value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get field in dictionary ^/
|
||||||
|
func Dictionary.GetField(dict, key)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,82 @@
|
|||||||
|
/^ Get Environment variable ^/
|
||||||
|
func Env.GetAt(key)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Set Environment variable ^/
|
||||||
|
func Env.SetAt(key,value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get Desktop Folder ^/
|
||||||
|
func Env.getDesktop()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ Get Downloads Folder ^/
|
||||||
|
func Env.getDownloads()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/^ Get Documents Folder ^/
|
/^ Get Documents Folder ^/
|
||||||
func Env.getDocuments()
|
func Env.getDocuments()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/^ Get Music Folder ^/
|
||||||
|
func Env.getMusic()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get Picture Folder ^/
|
||||||
|
func Env.getPictures()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get State Folder ^/
|
||||||
|
func Env.getState()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get Cache Folder ^/
|
||||||
|
func Env.getCache()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get Config Folder ^/
|
||||||
|
func Env.getConfig()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get CrossLang Config Folder ^/
|
||||||
|
func Env.getCrossLangConfig()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get Data Folder ^/
|
||||||
|
func Env.getData()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get User Folder ^/
|
||||||
|
func Env.getUser()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get Current Platform ^/
|
||||||
|
func Env.getPlatform()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get the real path for executable ^/
|
||||||
|
func Env.GetRealExecutablePath(path)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Get the environment path seperator (its a field not a property so it is uncallable) ^/
|
||||||
|
func Env.getEnvPathSeperator()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,3 +8,53 @@ func FS.WriteAllText(filesystem, path, contents)
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/^ Read bytes from file ^/
|
||||||
|
func FS.ReadAllBytes(filesystem, path)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Write bytes to file ^/
|
||||||
|
func FS.WriteAllBytes(filesystem, path, bytes)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ Create a crvm archive from fs to strm with name version and info^/
|
||||||
|
func FS.CreateArchive(fs, strm, name, version, info)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ Extract a crvm archive from strm to vfs ^/
|
||||||
|
func FS.ExtractArchive(strm, vfs)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/^ Its a field FS.Local with type LocalFilesystem ^/
|
||||||
|
func FS.getLocal()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ returns the current working directory ^/
|
||||||
|
func FS.getCurrentPath()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ set the current working directory ^/
|
||||||
|
func FS.setCurrentPath(path)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ Make absolute path from relative path ^/
|
||||||
|
func FS.MakeFull(path)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
12
Tesses.CrossLang.Reference/src/runtime_methods/net.tcross
Normal file
12
Tesses.CrossLang.Reference/src/runtime_methods/net.tcross
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/^ Get the ip addresses of the machine, pass true if you want ipv6, returns List of schema Net.IPAddress^/
|
||||||
|
func Net.getIPAddresses($ipv6)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
/^ schema from list entries from return value of Net.getIPAddresses ^/
|
||||||
|
class Net.IPAddress {
|
||||||
|
/^ The network interface ^/
|
||||||
|
public Interface;
|
||||||
|
/^ The ip address string ^/
|
||||||
|
public Address;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user