diff --git a/README.md b/README.md index 14d1e99b..4d22ff08 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,84 @@ # Con4m: Configuration and Far More -By the 1.0 release, Con4m will be easily available in Go, Python, C and Nim (in which it's written). Currently, we build both a command-line and libcon4m, so C and Nim are particularly easy. Once we get closer to 1.0 and the API is stable and well documented, we'll build deeper integrations with those languages. +Con4m makes it easy to give users rich configurability via config +files and command line flags. You just have to write a spec to get +your config file format and your command line flags / parsing. -## Brief Overview -To the typical user, Con4m looks like a normal config file, somewhere in the NginX family. But! power users get a statically typed Go-like language that seamlessly integrates, for any power user needs, but is tailored for configuration use cases (for instance, having built-in data types for things like dates, times, durations and sizes). But, Con4m can be invisible when people don't need the extra power. +You can do all of your input validation either through Con4m's built +in constraints, or through custom validation routines (themselves +written in con4m). Your main program can skip all that logic, and just +get (or set) fields through a simple API. -You just write your own configuration file that specifies: -1. What sections and fields your want your configuration file to have, and what properties you want them to have. -2. What command-line commands and arguments you want to accept, and the properties you want them to have. -3. Any other custom validation you want to do. +You can also document all your fields, commands and flags in your +spec, which is then all easily accessible at runtime, or export the +whole thing to JSon. + + +By the 1.0 release, Con4m will be easily available in Go, Python, C +and Nim (in which it's written). Currently, we build both a +command-line and libcon4m, so C and Nim are particularly easy. -Then, you just have to call con4m, passing your config, and then your user's configuration file. You'll then be able to query results, and if you like, change values, run callbacks, run additional config files in the same context (or in different contexts)... +But we've got a long way to go before 1.0-- we have a long backlog of +work that we only have been doing as needed for +[Chalk](https://github.com/crashappsec/chalk); once we ship that (in +mid Sept) we will spend significant time on it. -As an example, replicating the whole of the command-line parsing for Docker took me about two hours, most of which was copying from their docs. -Con4m validates configuration files before loading them, even making sure the types and values all what YOU need them to be, if your provide a brief specification defining the schema you want for your config files. That validation can include common constraints, (like the value must be from a fixed list, must be in a particular range). There are also constraints for field dependencies, and the ability to write custom field checkers. You basically just write the spec for what you want to accept in your config file, in Con4m, naturally. +## Brief Overview +To the typical user, Con4m looks like a normal config file, somewhere +in the NginX family. But! power users get a statically typed Go-like +language that seamlessly integrates, for any power user needs, but is +tailored for configuration use cases (for instance, having built-in +data types for things like dates, times, durations and sizes). But, +Con4m can be invisible when people don't need the extra power. -You are in total control-- do you want command-line flags to take prescendence over env variables? Over the config file? Do you want users to be able to add their own environment variables to suit their own needs? It's all easy. +You just write your own configuration file that specifies: -Con4m also allows you to 'stack' configuration files. For instance, the app can load an internal default configuration hardcoded into the program, then layer a system-level config over it, then layer a local config on top. +1. What sections and fields your want your configuration file to have, + and what properties you want them to have. -After the configuration file loads, you can call any user-defined functions provided, if your application might need feedback from the user after configuration loads. +2. What command-line commands and arguments you want to accept, and + the properties you want them to have. -You can also create your own builtin functions to make available to users who use the scripting capabilities. Con4m currently offers over 100 builtins, which you can selectively disable if you so choose. We always drop privs before running, and you can easily make full audits available. +3. Any other custom validation you want to do. + +Then, you just have to call con4m, passing your config, and then your +user's configuration file. You'll then be able to query results, and +if you like, change values, run callbacks, run additional config files +in the same context (or in different contexts)... + +As an example, replicating the whole of the command-line parsing for +Docker took me about two hours, most of which was copying from their +docs. + +Con4m validates configuration files before loading them, even making +sure the types and values all what YOU need them to be, if your +provide a brief specification defining the schema you want for your +config files. That validation can include common constraints, (like +the value must be from a fixed list, must be in a particular range). +There are also constraints for field dependencies, and the ability to +write custom field checkers. You basically just write the spec for +what you want to accept in your config file, in Con4m, naturally. + +You are in total control-- do you want command-line flags to take +prescendence over env variables? Over the config file? Do you want +users to be able to add their own environment variables to suit their +own needs? It's all easy. + +Con4m also allows you to 'stack' configuration files. For instance, +the app can load an internal default configuration hardcoded into the +program, then layer a system-level config over it, then layer a local +config on top. + +After the configuration file loads, you can call any user-defined +functions provided, if your application might need feedback from the +user after configuration loads. + +You can also create your own builtin functions to make available to +users who use the scripting capabilities. Con4m currently offers over +100 builtins, which you can selectively disable if you so choose. We +always drop privs before running, and you can easily make full audits +available. ## Basic Example @@ -124,38 +180,55 @@ getopts { } ``` -This will add top-level flags: `--color, --no-color, -c, -C, --help, -h, --log-level, -l, --info, --warn, --error, --verbose`. +This will add top-level flags: `--color, --no-color, -c, -C, --help, +-h, --log-level, -l, --info, --warn, --error, --verbose`. -It will also add a `run` command with its own sub-flags, generate a bunch of help docs, etc. +It will also add a `run` command with its own sub-flags, generate a +bunch of help docs, etc. -And on the command line, by default, con4m is as forgiving as possible. For example, it doesn't care about spaces around an '=', and if args are required, whether you drop it. Nor does it care if flags appear way before or after the command they're attached to (as long as there is no ambiguity). You can even have it try to guess the top-level command so that it can be omitted or provided as a default via config file. +And on the command line, by default, con4m is as forgiving as +possible. For example, it doesn't care about spaces around an '=', and +if args are required, whether you drop it. Nor does it care if flags +appear way before or after the command they're attached to (as long as +there is no ambiguity). You can even have it try to guess the +top-level command so that it can be omitted or provided as a default +via config file. # Getting Started -Currently, Con4m hasn't been officially released. We expect to provide a distro with the stand-alone compiler. But if you're interested, you could use it, or at least, follow along while we're working. +Currently, Con4m hasn't been officially released. We expect to provide +a distro with the stand-alone compiler. But if you're interested, you +could use it, or at least, follow along while we're working. -Right now, you have to build from source, which requires Nim (https://nim-lang.org/), a systems language that's fast and has strong memory safety by default, yet somehow feels like Python. +Right now, you have to build from source, which requires Nim +(https://nim-lang.org/), a systems language that's fast and has strong +memory safety by default, yet somehow feels like Python. But it +doesn't have much of an ecosystem. -If you have Nim installed, you can easily install the current version with nimble: +If you have Nim installed, you can easily install the current version +with nimble: ```bash nimble install https://github.com/crashappsec/con4m ``` -Then, you can run the `con4m` compiler, link to libcon4m, or, if you're a Nim user, simply `import con4m` +Then, you can run the `con4m` compiler, link to libcon4m, or, if +you're a Nim user, simply `import con4m` # More Information -- Getting started. -- [Learn about the Con4m configuration file syntax](docs/writing.md). It’s familiar, fast, easy, while being just powerful enough. And it always terminates. This is currently a bit out of date... we'll do a doc run before 1.0. -- [Con4m API docs for Nim.](docs/nim-api.md) -- Browse the current list of [builtin function calls](docs/builtins.md). This is similarly a bit out of date. -- Learn about planned features in [the Github backlog](https://github.com/crashappsec/con4m/issues). +There's a lot of documentation embedded in con4m, but we will focus on +documentation later in the year. For now, the core capabilities are +best documented in the Chalk documentation, since it's the Chalk +config file format. + +[Chalk](https://github.com/crashappsec/chalk) # About Con4m is open source under the Apache 2.0 license. -Con4m was written by John Viega (john@crashoverride.com). +Con4m was written by John Viega (john@crashoverride.com), originally +for Chalk and other to-be-named projects, because other options for +flexibile configs (like HCL, or YAML DSLs) all kinda suck. -Pull requests are welcome! If you want to make this work in another language, please do reach out to be first. diff --git a/con4m.nimble b/con4m.nimble index fca2e457..7324fab9 100644 --- a/con4m.nimble +++ b/con4m.nimble @@ -1,20 +1,15 @@ # Package -version = "0.8.10" +version = "0.1.0" author = "John Viega" description = "A generic configuration file format that allows for flexible, lightweight scripting." license = "Apache-2.0" -srcDir = "files" bin = @["con4m"] +srcDir = "files" installExt = @["nim", "c4m", "c42spec", "c", "h", "a"] # Dependencies -requires "nim >= 1.6.10" -requires "https://github.com/crashappsec/nimutils == 0.4.7" -requires "nimSHA2 == 0.1.1" - -let s = "nimble doc --project " & - "--git.url:https://github.com/crashappsec/con4m.git --git.commit:v" & - version & " --outdir:docs src/con4m.nim" +requires "nim >= 1.6.12" +requires "https://github.com/crashappsec/nimutils == 0.1.0" task ctest, "Build libcon4m": when hostOs == "linux" or hostOS == "macosx": diff --git a/config.nims b/config.nims index 3834d672..0ff8508e 100644 --- a/config.nims +++ b/config.nims @@ -5,6 +5,7 @@ switch("debugger", "native") switch("d", "nimPreviewHashRef") switch("d", "ssl") switch("d", "useOpenSSL3") +switch("gc", "refc") when (NimMajor, NimMinor) < (1, 7): # Locklevels never worked and are gone but warnings persist. @@ -21,7 +22,11 @@ when defined(macosx): # -d:arch=amd64 will allow you to specifically cross-compile to intel. # The .strdefine. pragma sets the variable from the -d: flag w/ the same # name, overriding the value of the const. - const arch {.strdefine.} = "detect" + const arch {.strdefine.} = "detect" + + # This one is used if we can't find where con4m ends up after nimble + # grabs the dep. + const nimblePkgRoot {.strdefine.} = "~/.nimble/pkgs2/" var targetArch = arch @@ -53,11 +58,57 @@ when defined(macosx): switch("passl", "-flto -w -target " & targetStr & "-Wl,-object_path_lto,lto.o") - if "con4m" in getCurrentDir(): + var deploc: string + + # If we are developing nim, everything has to be under files, + # but if it's building the exe from nimble, there will be no files dir. + if "con4m" notin getCurrentDir(): + + if nimblePkgRoot.startsWith("~"): + deploc = getenv("HOME") + if not deploc.endswith("/"): + deploc &= "/" + + let rest = nimblePkgRoot[1 .. ^1] + if not rest.startswith("/"): + deploc &= rest + else: + deploc &= rest[1 .. ^1] + + else: + deploc = nimblePkgRoot + + if not dirExists(deploc): + echo "This is a hacky work-around for a nimble issue." + exec "nimble install con4m" + if not dirExists(deploc): + echo "Cannot find nimble path. Please set -d:nimblePkgRoot to the ", + "location where con4m lives (usually ~/.nimble/pkgs2/)" + quit(1) + + let + latest = staticExec("ls " & deploc & " | egrep \"^con4m\" | " & + "sort -V | tail -1") + if latest.strip() == "": + echo "******************** WARNING ********************\n", + "Cannot find con4m install. You are probably installing ", + "it via Chalk or some similar program that uses con4m, and do ", + "not yet have con4m installed. The newer Nim package manager ", + "won't easily tell us where the tmp files it downloaded live, ", + "until it moves them in place, once the con4m install is done.\n", + "As a result, con4m will build without libraries it need to run.\n", + "When it's done, please run:\n\n", + " rm `which con4m`\n\n", + "and rebuild the app you are trying to build!" + + deploc = deploc & "/" & latest & "/deps/macos/" + else: + deploc = getCurrentDir() & "/files/deps/macos/" + if dirExists(depLoc): let libs = ["ssl", "crypto"] - libDir = getCurrentDir() & "/files/deps/macos/" & targetArch & "/" + libDir = deploc & targetArch & "/" for item in libs: let libFile = "lib" & item & ".a" diff --git a/docs/_._/con4m.html b/docs/_._/con4m.html deleted file mode 100644 index 1204a591..00000000 --- a/docs/_._/con4m.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m - - - - - - - - -
-
-

src/con4m

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Makes it easy to build Apache-style configuration files with well-defined schemas, where you don't have to do significant work.

-

And the people who write configuration files, can do extensive customization using the con4m language, which is built in a way that guarantees termination (e.g., no while loops, for loop index variables are immutible to the programmer).

- - -
Author:John Viega (john@crashoverride.com)
Copyright:2022
This operates on tokens, as already produced by lex(). It simply kicks off the parser by entering the top-level production (body), and prints out any error message that happened during parsing.

- - - -
-
- -
- -
-
-
- - - diff --git a/docs/builtins.md b/docs/builtins.md deleted file mode 100644 index 83d3567b..00000000 --- a/docs/builtins.md +++ /dev/null @@ -1,65 +0,0 @@ -# Con4m builtin calls as of v0.3.4 - -[Go back to the home page.](https://github.com/crashappsec/con4m) - -| Call | Con4m Type | Description | -| --- | --- | --- | -| Type Conversion Operations | | | -| bool | (int) → bool | Convert an integer to a true/false value. | -| bool | (float) → bool | Convert a float to a true/false value. | -| bool | (string) → bool | Convert a string to a true/false value. | -| bool | ([@T]) → bool | Convert a list of any type to a true/false value. | -| bool | ({@T : @V}) → bool | Convert a dictionary of any type to a true/false value. | -| float | (int) → float | Convert an integer to a floating point representation. | -| int | (float) → int | Convert a float to an integer by truncating the decimal part. | -| string | (bool) → string | Convert a boolean value to the string “true” or “false”. | -| string | (int) → string | convert an integer into a string. | -| string | (float) → string | Convert a float into a string. | -| String manipulation | | | -| contains | (string, string) → bool | Returns true if the first argument contains second argument anywhere. | -| find | (string, string) → int | If the first string contains the second as a substring, returns the starting byte index of the first match, starting from 0. If the substring is not found, this returns -1. | -| format | (string) → string | Makes substitutions within a string, based on variables that are in scope. For the input string, anything inside braces {} will be treated as a specifier. You can access attributes that are out of scope by fully dotting from the top-level name. Note that all tags are currently part of the dotted name. You can use both attributes and variables in a specifier. Strings, bools, ints and floats are acceptable for specifiers, but lists and dictionaries are not. Note that there is currently no way to specify things like padding and alignment in a format specifier. If you want to insert an actual { or } character that shouldn't be part of a specifier, quote them by doubling them up (e.g., {{ to get a single left brace)| -| len | (string) → int | Returns the number of bytes in a string | -| slice | (string, int) → string | Returns a new string that is a substring starting at the provided byte index, through the end of the string. As with languages like Python, negative values work, indexing from the back of the string. | -| slice | (string, int, int) → string | Returns a new string that is a substring starting at the first provided byte index, through the second provided index (not inclusive). As with languages like Python, negative values work, indexing from the back of the string. | -| split | (string, string) → [ string ] | Take the first string, and break it into a list containing all of the pieces that are separated by the second string, putting the results in a list. | -| strip | (string) → string | Returns a second string, with any trailing or leading whitespace removed. | -| pad | (string, int) → string | Puts the specified number of spaces in front of each line of a string. | -| Container Basics (i.e., lists and dicts) | | | -| len | ([@T]) → int | Returns the number of items in a string. | -| len | ({@T : @V}) → int | Returns the number of items in a dictionary. | -| keys | ({@K : @V}) → [@K] | Returns a list of the keys in a dictionary. | -| values | ({@K : @V}) → [@K] | Returns a list of the values in a dictionary. | -| items | ({@K : @V}) → [(@K, @V)] | Returns a list of the key / value pairs in a dictionary. | -| File System | | | -| listDir | () → [string] | Returns a list of files in the current working directory. | -| listDir | (string) → [string] | Returns a list of files in the specified directory. If the directory is invalid, no error is given; the results will be the same as if the directory were empty. | -| readFile | (string) → string | Returns the contents of the file. On error, this will return the empty string. | -| writeFile | (string, string) → bool | Writes, to the file name given in the first argument, the value of the string given in the second argument. Returns true if successful, false otherwise. | -| copyFile | (string, string) → bool | Copies the contents of the file specified by the first argument to the file specified by the second, creating the new file if necessary, overwriting it otherwise. Returns true if successful, false otherwise. | -| moveFile | (string, string) → bool | Moves the file specified by the first argument to the location specified by the second, overwriting any file, if present. Returns true if successful, false otherwise. | -| rmFile | (string) → bool | Removes the specified file, if allowed. Returns true if successful. | -| joinPath | (string, string) → string | Combines two pieces of a path in a way where you don't have to worry about extra slashes. | -| resolvePath | (string) → string | Turns a possibly relative path into an absolute path. This also expands home directories. | -| splitPath | (string) -> (string, string) | Separates out the final path component from the rest of the path, i.e., typically used to split out the file name from the remainder of the path. | -| cwd | () → string | Returns the current working directory of the process. | -| chdir | (string) → bool | Changes the current working directory of the process. Returns true if successful. | -| mkdir | (string) → bool | Creates a directory, and returns true on succes. | -| isDir | (string) → bool | Returns true if the given file name exists at the time of the call, and is a directory. | -| isFile | (string) → bool | Returns true if the given file name exists at the time of the call, and is a regular file. | -| isLink | (string) → bool | Returns true if the given file name exists at the time of the call, and is a link. | -| chmod | (string, int) → bool | Attempt to set the file permissions; returns true if successful. | -| filelen | (string) → int | Returns the number of bytes in the specified file, or -1 if there is an error (e.g., no file, or not readable) | -| System | | | -| echo | (string*) | Output a list of strings... to stderr, NOT stdout. A newline is added at the end, but no spaces are added between arguments. | -| abort | (string) | Stops the program immediately. | -| env | () → { string : string } | Returns a dictionary containing all environment variables and their contents. | -| env | (string) → string | Returns the value of a single environment variable. If not set, the empty string is returned. Note that it’s possible for environment variables to be set to an empty string, in which case use envContains() | -| envExists | (string) → bool | Returns true if the provided argument is a set environment variable, false otherwise. | -| setEnv | (string, string) → bool | Sets the environment variable specified in the first argument to the value specified in the second. Returns true if successful. | -| getpid | () → int | Returns the current process ID | -| quote | (string) → string | Takes a string, and quotes it in a way that's acceptable for passing to shells. | -| run | (string) → string | Runs a specified command, as if on the command line, returning the output (This is the same to the system() call in many languages). | -| system | (string) → (string, int) | Like system, runs a specified command as if on the command line, but returns a tuple consisting of the output and the exit code. Only available on Posix systems. | -| getuid | () → int | Returns the current uid of the process. | -| geteuid | () → int | Returns the current euid of the process. Note, however, that, even if the process has euid 0, those permissions will be dropped before any call that runs a command or might modify the file system. | diff --git a/docs/con4m.html b/docs/con4m.html deleted file mode 100644 index fe3cf31e..00000000 --- a/docs/con4m.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m - - - - - - - - -
-
-

src/con4m

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Makes it easy to build Apache-style configuration files with well-defined schemas, where you don't have to do significant work.

-

And the people who write configuration files, can do extensive customization using the con4m language, which is built in a way that guarantees termination (e.g., no while loops, for loop index variables are immutible to the programmer).

- - -
Author:John Viega (john@crashoverride.com)
Copyright:2022
This operates on tokens, as already produced by lex(). It simply kicks off the parser by entering the top-level production (body), and prints out any error message that happened during parsing.

- - - -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/box.html b/docs/con4m/box.html deleted file mode 100644 index 95544387..00000000 --- a/docs/con4m/box.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/box - - - - - - - - -
-
-

src/con4m/box

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

A type to allow us to store any value we might need for con4m, and defer type checking on those values (generally not until runtime, generally until later in the process).

-

I know that Nim does have an Any type, but this is simpler, and focused on the types that con4m allows. Part of the reason I built my own here is because I intend to cache hash codes here eventually, so that dictionary keys can be arbitrary types.

-

Plus, Nim Any types require some of the work here to avoid dangling references to sequences in particular.

- - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

-
-

Imports

-
-types -
-
-

Procs

-
-
-
proc box(value: bool): Box {....raises: [], tags: [].}
-
- -Converts a boolean value to a box object. -  Source -  Edit - -
-
-
-
proc box(value: float): Box {....raises: [], tags: [].}
-
- -Converts a float value to a box object. -  Source -  Edit - -
-
-
-
proc box(value: int): Box {....raises: [], tags: [].}
-
- -Converts an int value to a box object. Note that con4m only allows the natural int type (usually 64 bit signed). -  Source -  Edit - -
-
-
-
proc box(value: string): Box {....raises: [], tags: [].}
-
- -Converts a string value to a box object. -  Source -  Edit - -
-
-
-
proc boxDict[K, V](value: TableRef[K, V]): Box
-
- -Converts a Tableref to a box object. This has to be named, because Nim doesn't seem to be able to distinguish between this and box[T] with dictionaries, even though they're generic types w/ two type parameters :) -  Source -  Edit - -
-
-
-
proc boxList[T](value: seq[T]): Box
-
- -Converts a sequence to a box object. -  Source -  Edit - -
-
-
-
proc unbox[T](box: Box): T
-
- -Generically unboxes any data type. -  Source -  Edit - -
-
-
-
proc unboxDict[K, V](box: Box): TableRef[K, V]
-
- - -  Source -  Edit - -
-
-
-
proc unboxList[T](box: Box): seq[T]
-
- - -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/box.idx b/docs/con4m/box.idx deleted file mode 100644 index c9a85ea4..00000000 --- a/docs/con4m/box.idx +++ /dev/null @@ -1,9 +0,0 @@ -box con4m/box.html#box,bool box: box(value: bool): Box -box con4m/box.html#box,string box: box(value: string): Box -box con4m/box.html#box,int box: box(value: int): Box -box con4m/box.html#box,float box: box(value: float): Box -boxList con4m/box.html#boxList,seq[T] box: boxList[T](value: seq[T]): Box -boxDict con4m/box.html#boxDict,TableRef[K,V] box: boxDict[K, V](value: TableRef[K, V]): Box -unbox con4m/box.html#unbox,Box box: unbox[T](box: Box): T -unboxList con4m/box.html#unboxList,Box box: unboxList[T](box: Box): seq[T] -unboxDict con4m/box.html#unboxDict,Box box: unboxDict[K, V](box: Box): TableRef[K, V] diff --git a/docs/con4m/builtins.html b/docs/con4m/builtins.html deleted file mode 100644 index 54915883..00000000 --- a/docs/con4m/builtins.html +++ /dev/null @@ -1,900 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/builtins - - - - - - - - -
-
-

src/con4m/builtins

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Built in functions. I will add more of these as I find them useful. They're all exposed so that you can selectively re-use them. - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

- -
-

Procs

-
-
-
proc addDefaultBuiltins(s: ConfigState) {.
-    ...raises: [ValueError, Con4mError, KeyError, IOError, OSError, Exception], tags: [
-    WriteIOEffect, ReadEnvEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
-
- -

This function loads existing default builtins. It gets called automatically if you ever call newConfigState(), checkTree(node), evalTree(), evalConfig(), or con4m().

-

That is, you probably don't have to call this, though it will silently do nothing if you double-add.

-

Instead, you probably should just use newBuiltIn() to add your own calls, unless you want to remove or rename things.

- -  Source -  Edit - -
-
-
-
proc builtInAbort(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                  unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Stops the entire program (not just the configuration file). Generally exposed as abort() -  Source -  Edit - -
-
-
-
proc builtinBToS(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast bools to strings. Exposed as string(b) by default. -  Source -  Edit - -
-
-
-
proc builtinCmd(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [OSError, Exception, IOError],
-           tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
-
- -

Generally exposed as run(s)

-

Essentially calls the posix system() call, except that, a) stderr gets merged into stdout, b) the exit code is put at the start of the output, separated from the rest of the output with a colon, and c) this ALWAYS drops euid and egid in a setuid/setgid program, to avoid an attacker using a configuration file to run arbitrary commands as root.

-

Note that this does restore privileges in the parent process once the command returns, but in a multi-threaded program, this might be worth noting, since threads at startup time are more likely to need permissions.

-

Currently this is not dropping other Linux capabilities; I've been developing on my Mac so haven't gotten around to it yet. Since they can never be returned to a process once dropped, that might require a fork and a pipe?

- -  Source -  Edit - -
-
-
-
proc builtinContainsStrStr(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                           unused2 = cast[VarStack](nil);
-                           unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [], tags: [].}
-
- -Returns true if s1 contains the substring s2. Exposed by default as contains(s1, s2) -  Source -  Edit - -
-
-
-
proc builtInDictKeys(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                     unused2 = cast[VarStack](nil);
-                     unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [ValueError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc builtInDictLen(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                    unused2 = cast[VarStack](nil);
-                    unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [ValueError], tags: [].}
-
- -Returns the number of k,v pairs in a dictionary. -  Source -  Edit - -
-
-
-
proc builtinDToB(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [ValueError], tags: [].}
-
- -Cast dicitonaries of any type to booleans (testing for empty lists). Exposed as bool(s) by default. -  Source -  Edit - -
-
-
-
proc builtinEcho(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [IOError], tags: [WriteIOEffect].}
-
- -Exposed as echo(*s) by default. Prints the parameters to stdout, followed by a newline at the end. Note that this does NOT add spaces between arguments for you. -  Source -  Edit - -
-
-
-
proc builtinEnv(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [ReadEnvEffect].}
-
- -Exposed as env(s) by default. Returns the value of the requested environment variable. If the environment variable is NOT set, it will return the empty string. To distingush between the environment variable not being set, or the variable being set to the empty string, use builtinEnvExists. -  Source -  Edit - -
-
-
-
proc builtinEnvAll(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                   unused2 = cast[VarStack](nil);
-                   unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [ValueError], tags: [ReadEnvEffect].}
-
- -Return a dictionary with all envvars and their values. Exposed by default as env() -  Source -  Edit - -
-
-
-
proc builtinEnvExists(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                      unused2 = cast[VarStack](nil);
-                      unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [], tags: [ReadEnvEffect].}
-
- -

Returns true if the requested variable name is set in the environment, false if it's not. Exposed as envExists(s) by default.

-

Note that this can be used to distinguish between the variable not existing, and the variable being set explicitly to the empty string.

- -  Source -  Edit - -
-
-
-
proc builtinFindFromStart(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                          unused2 = cast[VarStack](nil);
-                          unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [], tags: [].}
-
- -Returns the index of the substring s2's first appearence in the string s1, or -1 if it does not appear. Exposed by default as find(s1, s2) -  Source -  Edit - -
-
-
-
proc builtInFormat(args: seq[Box]; attrs: Con4mScope; vars: VarStack;
-                   localScope: Con4mScope): Option[Box] {.
-    ...raises: [Con4mError, KeyError, ValueError], tags: [].}
-
- -We don't error check on string bounds; when an exception gets raised, SCall will call fatal(). -  Source -  Edit - -
-
-
-
proc builtinFtoB(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast floats to booleans (testing for non-zero). Exposed as bool(f) by default. -  Source -  Edit - -
-
-
-
proc builtinFToI(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast an float to an int (truncating). Exposed as int(f) by default. -  Source -  Edit - -
-
-
-
proc builtinFToS(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast floats to strings. Exposed as string(f) by default. -  Source -  Edit - -
-
-
-
proc builtinItoB(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast integers to booleans (testing for non-zero). Exposed as bool(i) by default. -  Source -  Edit - -
-
-
-
proc builtinIToF(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast an integer to a float. Exposed as float(i) by default. -  Source -  Edit - -
-
-
-
proc builtinIToS(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast integers to strings. Exposed as string(i) by default. -  Source -  Edit - -
-
-
-
proc builtInListLen(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                    unused2 = cast[VarStack](nil);
-                    unused3 = cast[Con4mScope](nil)): Option[Box] {....raises: [],
-    tags: [].}
-
- -Returns the number of elements in the list. -  Source -  Edit - -
-
-
-
proc builtinLToB(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast lists of any type to booleans (testing for empty lists). Exposed as bool(s) by default. -  Source -  Edit - -
-
-
-
proc builtInPad(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc builtinSlice(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                  unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Returns the substring of s starting at index start, not including index end. The semantics of this are Pythonic, where
-1 works as expected.
-

Note that an index out of bounds will not error. If both indicies are out of bounds, you'll get the empty string. usually exposed as slice(s, start, end)

- -  Source -  Edit - -
-
-
-
proc builtinSliceToEnd(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                       unused2 = cast[VarStack](nil);
-                       unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [], tags: [].}
-
- -

Returns the substring of s starting at index start, until the end of the string. The semantics of this are Pythonic, where -1 works as expected (to index from the back).

-

Note that an index out of bounds will not error. If both indicies are out of bounds, you'll get the empty string. usually exposed as slice(s, start)

- -  Source -  Edit - -
-
-
-
proc builtinSplit(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                  unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Takes the first argument, and converts it into a list, spliting it out based on the pattern in the second string. This should work as expected from other languages. Exposed as split(s1, s2) by default. -  Source -  Edit - -
-
-
-
proc builtinStoB(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                 unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Cast strings to booleans (testing for empty strings). Exposed as bool(s) by default. -  Source -  Edit - -
-
-
-
proc builtinStrip(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                  unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[
-    Box] {....raises: [], tags: [].}
-
- -Remove leading and trailing white space from a string. Exposed by default as strip(s) -  Source -  Edit - -
-
-
-
proc builtInStrLen(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                   unused2 = cast[VarStack](nil);
-                   unused3 = cast[Con4mScope](nil)): Option[Box] {....raises: [],
-    tags: [].}
-
- -Returns the number of bytes in a string. -  Source -  Edit - -
-
-
-
proc builtinSystem(args: seq[Box]; unused1 = cast[Con4mScope](nil);
-                   unused2 = cast[VarStack](nil);
-                   unused3 = cast[Con4mScope](nil)): Option[Box] {.
-    ...raises: [OSError, Exception, IOError],
-    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
-
- -

Generally exposed as system(s)

-

like run except returns a tuple containing the output and the exit code.

- -  Source -  Edit - -
-
-
-
proc newBuiltIn(s: ConfigState; name: string; fn: BuiltInFn; tinfo: string) {.
-    ...raises: [ValueError, Con4mError, KeyError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc newCallback(s: ConfigState; name: string; tinfo: string) {.
-    ...raises: [ValueError, Con4mError, KeyError], tags: [].}
-
- - -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/builtins.idx b/docs/con4m/builtins.idx deleted file mode 100644 index 3ea1d50f..00000000 --- a/docs/con4m/builtins.idx +++ /dev/null @@ -1,32 +0,0 @@ -builtinIToS con4m/builtins.html#builtinIToS,seq[Box] builtins: builtinIToS(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinBToS con4m/builtins.html#builtinBToS,seq[Box] builtins: builtinBToS(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinFToS con4m/builtins.html#builtinFToS,seq[Box] builtins: builtinFToS(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinItoB con4m/builtins.html#builtinItoB,seq[Box] builtins: builtinItoB(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinFtoB con4m/builtins.html#builtinFtoB,seq[Box] builtins: builtinFtoB(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinStoB con4m/builtins.html#builtinStoB,seq[Box] builtins: builtinStoB(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinLToB con4m/builtins.html#builtinLToB,seq[Box] builtins: builtinLToB(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinDToB con4m/builtins.html#builtinDToB,seq[Box] builtins: builtinDToB(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinIToF con4m/builtins.html#builtinIToF,seq[Box] builtins: builtinIToF(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinFToI con4m/builtins.html#builtinFToI,seq[Box] builtins: builtinFToI(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinSplit con4m/builtins.html#builtinSplit,seq[Box] builtins: builtinSplit(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinEcho con4m/builtins.html#builtinEcho,seq[Box] builtins: builtinEcho(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinEnv con4m/builtins.html#builtinEnv,seq[Box] builtins: builtinEnv(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinEnvExists con4m/builtins.html#builtinEnvExists,seq[Box] builtins: builtinEnvExists(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinEnvAll con4m/builtins.html#builtinEnvAll,seq[Box] builtins: builtinEnvAll(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinStrip con4m/builtins.html#builtinStrip,seq[Box] builtins: builtinStrip(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinContainsStrStr con4m/builtins.html#builtinContainsStrStr,seq[Box] builtins: builtinContainsStrStr(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil);\n unused3 = cast[Con4mScope](nil)): Option[Box] -builtinFindFromStart con4m/builtins.html#builtinFindFromStart,seq[Box] builtins: builtinFindFromStart(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil);\n unused3 = cast[Con4mScope](nil)): Option[Box] -builtinSlice con4m/builtins.html#builtinSlice,seq[Box] builtins: builtinSlice(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinSliceToEnd con4m/builtins.html#builtinSliceToEnd,seq[Box] builtins: builtinSliceToEnd(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtInFormat con4m/builtins.html#builtInFormat,seq[Box],Con4mScope,VarStack,Con4mScope builtins: builtInFormat(args: seq[Box]; attrs: Con4mScope; vars: VarStack;\n localScope: Con4mScope): Option[Box] -builtInAbort con4m/builtins.html#builtInAbort,seq[Box] builtins: builtInAbort(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtInListLen con4m/builtins.html#builtInListLen,seq[Box] builtins: builtInListLen(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtInStrLen con4m/builtins.html#builtInStrLen,seq[Box] builtins: builtInStrLen(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtInDictLen con4m/builtins.html#builtInDictLen,seq[Box] builtins: builtInDictLen(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtInDictKeys con4m/builtins.html#builtInDictKeys,seq[Box] builtins: builtInDictKeys(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtInPad con4m/builtins.html#builtInPad,seq[Box] builtins: builtInPad(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinCmd con4m/builtins.html#builtinCmd,seq[Box] builtins: builtinCmd(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -builtinSystem con4m/builtins.html#builtinSystem,seq[Box] builtins: builtinSystem(args: seq[Box]; unused1 = cast[Con4mScope](nil);\n unused2 = cast[VarStack](nil); unused3 = cast[Con4mScope](nil)): Option[\n Box] -newBuiltIn con4m/builtins.html#newBuiltIn,ConfigState,string,BuiltInFn,string builtins: newBuiltIn(s: ConfigState; name: string; fn: BuiltInFn; tinfo: string) -newCallback con4m/builtins.html#newCallback,ConfigState,string,string builtins: newCallback(s: ConfigState; name: string; tinfo: string) -addDefaultBuiltins con4m/builtins.html#addDefaultBuiltins,ConfigState builtins: addDefaultBuiltins(s: ConfigState) diff --git a/docs/con4m/codegen.html b/docs/con4m/codegen.html deleted file mode 100644 index a3d87718..00000000 --- a/docs/con4m/codegen.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/codegen - - - - - - - - -
-
-

src/con4m/codegen

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Macros for abstracting away config file specification, parsing, validation and loading. - -
Author:John Viega (john@crashoverride.com)
Copyright:2022
More helper functions for creating symbol names that we'll use.

- -
-

Templates

-
-
-
template con4m(nameBase: untyped; confstr: string; rest: untyped): untyped
-
- -This is our main wrapper that bundles up parsing, checking, evaling, ... It both returns your config object, but also injects the context object so you can load a second file on top of it.
nameBase is the base name of your configuration file. Con4m
-
will use that to generate some of the symbols it exports.
-
-

Currently, this macro will export a few different symbols, specifically:

-
  1. If the first parameter is example It will inject a symbol called ctxExampleConf, which will be an object representing your configuration, from which you can access the fields directly once the configuration file is loaded, using the names in the specification you provide in this macro (see below).
  2. -
  3. A type declaration for the previous symbol. Again, if the first parameter is example, then the top level type will be called ExampleConfig. So your context will have been declared: ctxExampleConf: ExampleConfig.
  4. -
  5. Type declarations for each unique section you defined. Currently, if a section name is, for example host, it will take the form of: HostSection.
  6. -
  7. There are some helper variables that need to be hidden, because they don't need to be exposed, but I haven't done that yet: tmpBox, currentSt, sections, stEntry, entryOpt, confSpecExample (where Example is your name). Again, all of these should go away.
  8. -
  9. A function called loadExampleConf(ctx: ExampleConfig). con4m() actually calls this function for you, but you can re-call it if you need to. There is a lower-level version of the macro that this builds upon, called configDef, that does NOT call it for you, if you need to customize more.
  10. -
-

The confstr argument is the configuration file you want to parse.

-

While con4m() does NOT read in the config file for you, it

-

does do everything else... parse it, check it for consistency, evaluate it, check it against your specification. The configDef() just generates the supporting code to build the spec.

-

Because we generate a proc for you, con4m() cannot be invoked from within a function, only at the module level (a nested procedure wouldn't be intuitive).

-

The last argument to con4m() is a block of commands to define sections and attributes. No other code may appear in this block; it will result in an error.

-

Currently, there are only two commands:

-

section, which creates a section definition; and

-
attr, which defines an attribute, placing it either in the
-
section (When the attribute appears in a section block), or as an attribute in the global namespace, when not.
-
- -

The section command

This takes only two required arguments:

-
  • The first argument is always the name of a section, as an identifier. Eg, host
  • -
  • The last argument is a block, which can constitute attr commands, or other section commands. Eventually, nested subsections will define sections that only apply inside the specified section. However, they currently just create a new top-level section.
  • -
-

Optional keyword commands to section

-
  1. allowCustomAttrs, a boolean, indicating whether the user should be allowed to make up their own attributes in this section. This defaults to false.
  2. -
  3. doc, a string, which is documentation for that part of the configuration file. While this is stored if provided, it currently is unused.
  4. -
  5. requiredSubSections, a seq[string] of subsection names that a user MUST provide. Provide each option in dot notation, and a name can be replaced with a "*" to match anything for that dot. If not provided, there are no required sections.
  6. -
  7. allowedSubSections, also a seq[string], which is very similar, and again, is not checked if not provided. Note that requiredSubsections are implicitly allowed, so you don't need to double spec them. If not provided, this defaults to "*", allowing any section name, but no nesting. Not providing either would disallow any subsection, only allowing a single instance of the toplevel section.
  8. -
-

Subsections are probably misnomers here, where we will probably change the terminology at some point. This are more section modifiers, the set of which needs to be unique. Subsections will become nested sections of different types, once we implement those.

-

Currently, the macros do NOT provide an interface to any user-defined attributes. You have to search through the raw data manually. Making such items available more directly is a TODO item.

- -

The attr command

This command takes the following arguments:

-
  1. The name of the attribute, as an identifier. Note that it's okay to use Nim keywords here, they get automatically quoted (this also happens when they are used in sections). This is required.
  2. -
  3. The Con4m type to enforce for the attribute (NOT the Nim type). This is required.
  4. -
  5. defaultVal, a keyword parameter specifying what value to set if the user does not provide something for this attribute, when defining a section.
  6. -
  7. required, a keyword parameter indicating whether con4m should throw an error when this is not present in a section. If you set defaultVal, this will be ignored. This defaults to true if not provided.
  8. -
  9. lockOnWrite, a keyword parameter indicating that, once a configuration has set this value, it may not be written in future config file loads that reuse the same underlying configuration state. This allows you to provide internal "configuration" parameters within your program (by reading your config from a string in memory, for instance), without risking them getting clobbered. This defaults to false.
  10. -
  11. doc, a keyword parameter, represents a doc string. But, as above, this is not yet used.
  12. -
  13. validator, a custom callback for this field so that you can easily do additional validation beyond what con4m already does. This is NOT yet implemented.
  14. -
-

Note that fields that are not required and do not have a default provided will be declared as Optional[] types so you can determine whether the user provided them safely.

-

In future releases, we expect to handle nested sections, and also to make it easy to configure adding custom builtin functions with a separate command.

-

Note that Nim allows you to use attribute_name and attributeName interchangably. However, con4m does NOT, it will only accept the name you provide.

- -  Source -  Edit - -
-
-
-
template configDef(nameNode: untyped; rest: untyped)
-
- -

This template calls our macro does all the definitions for us, but does not handle the parsing, evaluation, or checking. It just generates code for us. The kludge variable is to ensure we don't run in a function scope, so that we can inject the loadNNNConfig() procedure.

-

This is particularly useful when we want to add our own custom built-in functions. We may change those to be part of the macro system.

- -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/codegen.idx b/docs/con4m/codegen.idx deleted file mode 100644 index 29a7a0e6..00000000 --- a/docs/con4m/codegen.idx +++ /dev/null @@ -1,4 +0,0 @@ -configDef con4m/codegen.html#configDef.t,untyped,untyped codegen: configDef(nameNode: untyped; rest: untyped) -con4m con4m/codegen.html#con4m.t,untyped,string,untyped codegen: con4m(nameBase: untyped; confstr: string; rest: untyped): untyped -The section command con4m/codegen.html#the-nimsection-command The section command -The attr command con4m/codegen.html#the-nimattr-command The attr command diff --git a/docs/con4m/con4m_types.html b/docs/con4m/con4m_types.html deleted file mode 100644 index fc5c9e3a..00000000 --- a/docs/con4m/con4m_types.html +++ /dev/null @@ -1,744 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/con4m_types - - - - - - - - -
-
-

src/con4m/con4m_types

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Data types used across the project. We generally try to keep types out of this file if they're only used in one module (particularly true in macros.nim, which is all compile-time). - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

-
-

Types

-
-
-
AttrSpec = ref object
-  doc*: string
-  attrType*: string
-  validator*: Option[FieldValidator]
-  defaultVal*: Option[Box]
-  lockOnWrite*: bool
-  required*: bool
-
-
- -Internal. This is the data structure holding specification data for individual attributes, used to check for well-formed config files, to plug in defaults, ... -  Source -  Edit - -
-
-
-
Box = ref object
-  case kind*: Con4mTypeKind
-  of TypeBool:
-    b*: bool
-  of TypeString:
-    s*: string
-  of TypeInt:
-    i*: int
-  of TypeFloat:
-    f*: float
-  else:
-      p*: pointer
-
-  
-
- -

This type is used in cases where a specification allows multiple types to be stored. This shouldn't happen often, but hey, here you go.

-

The macros remove the need to explicitly use boxing when you do pre-specify types.

- -  Source -  Edit - -
-
-
-
BuiltInFn = (seq[Box] -> Option[Box])
-
- - -  Source -  Edit - -
-
-
-
BuiltInInfo = ref object
-  fn*: BuiltInFn
-  tinfo*: Con4mType
-
-
- -Internal; table entry for the registered builtin functions. -  Source -  Edit - -
-
-
-
Con4mNode = ref object
-  kind*: Con4mNodeKind
-  token*: Option[Con4mToken]
-  children*: seq[Con4mNode]
-  parent*: Option[Con4mNode]
-  typeInfo*: Con4mType
-  scopes*: Option[CurScopes]
-  value*: Box
-
-
- -The actual parse tree node type. Should generally not be exposed. -  Source -  Edit - -
-
-
-
Con4mNodeKind = enum
-  NodeBody, NodeAttrAssign, NodeVarAssign, NodeSection, NodeIfStmt,
-  NodeConditional, NodeElse, NodeFor, NodeBreak, NodeContinue, NodeSimpLit,
-  NodeUnary, NodeNot, NodeMember, NodeIndex, NodeActuals, NodeCall, NodeDictLit,
-  NodeKVPair, NodeListLit, NodeOr, NodeAnd, NodeNe, NodeCmp, NodeGte, NodeLte,
-  NodeGt, NodeLt, NodePlus, NodeMinus, NodeMod, NodeMul, NodeDiv, NodeEnum,
-  NodeIdentifier
-
- -Parse tree nodes types. Really no reason for these to be exposed either, other than the fact that they're contained in state objects that are the primary object type exposed to the user. -  Source -  Edit - -
-
-
-
Con4mScope = ref object
-  parent*: Option[Con4mScope]
-  entries*: OrderedTable[string, STEntry]
-
-
- -Internal. It represents a single scope, only containing a dictionary plus a link to out parent scope, if any. -  Source -  Edit - -
-
-
-
Con4mSectInfo = seq[(string, Con4mScope)]
-
- - -  Source -  Edit - -
-
-
-
Con4mToken = ref object
-  case kind*: Con4mTokenKind
-  of TtStringLit:
-      unescaped*: string
-
-  else:
-      nil
-
-  startPos*, endPos*, lineNo*, lineOffset*: int
-  stream*: Stream
-
-
- -Lexical tokens. Should not be exposed outside the package. -  Source -  Edit - -
-
-
-
Con4mTokenKind = enum
-  TtWhiteSpace, TtSemi, TtNewLine, TtLineComment, TtPlus, TtMinus, TtMul,
-  TtLongComment, TtDiv, TTMod, TtLte, TtLt, TtGte, TtGt, TtNeq, TtNot,
-  TtLocalAssign, TtColon, TtAttrAssign, TtCmp, TtComma, TtPeriod, TtLBrace,
-  TtRBrace, TtLBracket, TtRBracket, TtLParen, TtRParen, TtAnd, TtOr, TtIntLit,
-  TtFloatLit, TtStringLit, TtTrue, TtFalse, TtNull, TTIf, TTElIf, TTElse, TtFor,
-  TtFrom, TtTo, TtBreak, TtContinue, TtEnum, TtIdentifier, TtSof, TtEof,
-  ErrorTok, ErrorLongComment, ErrorStringLit
-
- - -  Source -  Edit - -
-
-
-
Con4mType = ref object
-  case kind*: Con4mTypeKind
-  of TypeList:
-      itemType*: Con4mType
-
-  of TypeDict:
-      keyType*, valType*: Con4mType
-
-  of TypeProc:
-      params*: seq[Con4mType]
-      va*: bool
-      retType*: Con4mType
-
-  of TypeTVar:
-      varNum*: int
-
-  else:
-    nil
-  
-
- -The internal representation of a type. Generally, you should write strings, and con4m will parse them. -  Source -  Edit - -
-
-
-
Con4mTypeKind = enum
-  TypeString, TypeBool, TypeInt, TypeFloat, TypeList, TypeDict, TypeProc,
-  TypeTVar, TypeBottom
-
- -The enumeration of possible top-level types in Con4m -  Source -  Edit - -
-
-
-
ConfigSpec = ref object
-  builtins*: OrderedTable[string, seq[BuiltInInfo]]
-  secSpecs*: OrderedTable[string, SectionSpec]
-  globalAttrs*: FieldAttrs
-  customTopLevelOk*: bool
-
-
- -

The main user-level abstraction for holding specification data for a config file schema. Fill it with calls to addAttr(), addSection(), etc (or, better yet, through the con4m() macro).

-

The spec will be used to ensure the config file is well formed enough to work with, by comparing it against the results of execution.

- -  Source -  Edit - -
-
-
-
ConfigState = ref object
-  stateObjs*: OrderedTable[string, SectionState]
-  st*: Con4mScope
-  spec*: Option[ConfigSpec]
-  errors*: seq[string]
-  builtins*: Table[string, seq[BuiltInInfo]]
-
-
- -The top-level representation of a configuration's runtime state. The symbols are in here, the specs we apply, etc. Still, the end user should not need to access the members, except via API. -  Source -  Edit - -
-
-
-
CurScopes = object
-  vars*: Con4mScope
-  attrs*: Con4mScope
-
-
- -

At any point in a Con4m program, there are to different scopes, variable scopes (which change whenever we enter a new block like in a for loop), and attribute scopes, which nest based on sections.

-

Conceptually, the program that loads the configuration file is expected to only make use of the attributes; the variables are private to the config file's execution.

-

This helps make it easy for users to do computation, without polluting the runtime namespace, or making validation more challenging.

- -  Source -  Edit - -
-
-
-
FieldAttrs = OrderedTable[string, AttrSpec]
-
- - -  Source -  Edit - -
-
-
-
FieldValidator = (seq[string], Box) -> bool
-
- - -  Source -  Edit - -
-
-
-
SectionSpec = ref object
-  requiredSubsections*: seq[string]
-  allowedSubsections*: seq[string]
-  predefinedAttrs*: FieldAttrs
-  customAttrs*: bool
-  doc*: string
-  associatedSpec*: ConfigSpec ## Don't use this, it's only temporary to
-                              ## support having *some* code in place
-                              ## for seprately typed subsections.
-  
-
- -Internal. This holds specification data for a top-level section. -  Source -  Edit - -
-
-
-
SectionState = ref object
-  isLocked*: bool
-  substateObjs*: OrderedTable[string, SectionState]
-  beenSeen*: bool
-
-
- -Internal. This holds the overall information about a single section's evauluation state, for use primarily in checking to make sure required sections are present. -  Source -  Edit - -
-
-
-
STEntry = ref object
-  tInfo*: Con4mType
-  value*: Option[Box]
-  subscope*: Option[Con4mScope]
-  firstDef*: Option[Con4mNode]
-  locked*: bool
-
-
- -Internal; our symbol table data structure. -  Source -  Edit - -
-
- -
-
-

Lets

-
-
-
boolType = Con4mType(kind: TypeBool)
-
- - -  Source -  Edit - -
-
-
-
bottomType = Con4mType(kind: TypeBottom)
-
- - -  Source -  Edit - -
-
-
-
floatType = Con4mType(kind: TypeFloat)
-
- - -  Source -  Edit - -
-
-
-
intType = Con4mType(kind: TypeInt)
-
- - -  Source -  Edit - -
-
-
-
stringType = Con4mType(kind: TypeString)
-
- - -  Source -  Edit - -
-
- -
-
-

Templates

-
-
-
template unreachable()
-
- -We use this to be explicit about case statements that are necessary to cover all cases, but should be impossible to execute. That way, if they do execute, we know we made a mistake. -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/con4m_types.idx b/docs/con4m/con4m_types.idx deleted file mode 100644 index 046210b3..00000000 --- a/docs/con4m/con4m_types.idx +++ /dev/null @@ -1,121 +0,0 @@ -TtWhiteSpace con4m/con4m_types.html#TtWhiteSpace Con4mTokenKind.TtWhiteSpace -TtSemi con4m/con4m_types.html#TtSemi Con4mTokenKind.TtSemi -TtNewLine con4m/con4m_types.html#TtNewLine Con4mTokenKind.TtNewLine -TtLineComment con4m/con4m_types.html#TtLineComment Con4mTokenKind.TtLineComment -TtPlus con4m/con4m_types.html#TtPlus Con4mTokenKind.TtPlus -TtMinus con4m/con4m_types.html#TtMinus Con4mTokenKind.TtMinus -TtMul con4m/con4m_types.html#TtMul Con4mTokenKind.TtMul -TtLongComment con4m/con4m_types.html#TtLongComment Con4mTokenKind.TtLongComment -TtDiv con4m/con4m_types.html#TtDiv Con4mTokenKind.TtDiv -TTMod con4m/con4m_types.html#TTMod Con4mTokenKind.TTMod -TtLte con4m/con4m_types.html#TtLte Con4mTokenKind.TtLte -TtLt con4m/con4m_types.html#TtLt Con4mTokenKind.TtLt -TtGte con4m/con4m_types.html#TtGte Con4mTokenKind.TtGte -TtGt con4m/con4m_types.html#TtGt Con4mTokenKind.TtGt -TtNeq con4m/con4m_types.html#TtNeq Con4mTokenKind.TtNeq -TtNot con4m/con4m_types.html#TtNot Con4mTokenKind.TtNot -TtLocalAssign con4m/con4m_types.html#TtLocalAssign Con4mTokenKind.TtLocalAssign -TtColon con4m/con4m_types.html#TtColon Con4mTokenKind.TtColon -TtAttrAssign con4m/con4m_types.html#TtAttrAssign Con4mTokenKind.TtAttrAssign -TtCmp con4m/con4m_types.html#TtCmp Con4mTokenKind.TtCmp -TtComma con4m/con4m_types.html#TtComma Con4mTokenKind.TtComma -TtPeriod con4m/con4m_types.html#TtPeriod Con4mTokenKind.TtPeriod -TtLBrace con4m/con4m_types.html#TtLBrace Con4mTokenKind.TtLBrace -TtRBrace con4m/con4m_types.html#TtRBrace Con4mTokenKind.TtRBrace -TtLBracket con4m/con4m_types.html#TtLBracket Con4mTokenKind.TtLBracket -TtRBracket con4m/con4m_types.html#TtRBracket Con4mTokenKind.TtRBracket -TtLParen con4m/con4m_types.html#TtLParen Con4mTokenKind.TtLParen -TtRParen con4m/con4m_types.html#TtRParen Con4mTokenKind.TtRParen -TtAnd con4m/con4m_types.html#TtAnd Con4mTokenKind.TtAnd -TtOr con4m/con4m_types.html#TtOr Con4mTokenKind.TtOr -TtIntLit con4m/con4m_types.html#TtIntLit Con4mTokenKind.TtIntLit -TtFloatLit con4m/con4m_types.html#TtFloatLit Con4mTokenKind.TtFloatLit -TtStringLit con4m/con4m_types.html#TtStringLit Con4mTokenKind.TtStringLit -TtTrue con4m/con4m_types.html#TtTrue Con4mTokenKind.TtTrue -TtFalse con4m/con4m_types.html#TtFalse Con4mTokenKind.TtFalse -TtNull con4m/con4m_types.html#TtNull Con4mTokenKind.TtNull -TTIf con4m/con4m_types.html#TTIf Con4mTokenKind.TTIf -TTElIf con4m/con4m_types.html#TTElIf Con4mTokenKind.TTElIf -TTElse con4m/con4m_types.html#TTElse Con4mTokenKind.TTElse -TtFor con4m/con4m_types.html#TtFor Con4mTokenKind.TtFor -TtFrom con4m/con4m_types.html#TtFrom Con4mTokenKind.TtFrom -TtTo con4m/con4m_types.html#TtTo Con4mTokenKind.TtTo -TtBreak con4m/con4m_types.html#TtBreak Con4mTokenKind.TtBreak -TtContinue con4m/con4m_types.html#TtContinue Con4mTokenKind.TtContinue -TtEnum con4m/con4m_types.html#TtEnum Con4mTokenKind.TtEnum -TtIdentifier con4m/con4m_types.html#TtIdentifier Con4mTokenKind.TtIdentifier -TtSof con4m/con4m_types.html#TtSof Con4mTokenKind.TtSof -TtEof con4m/con4m_types.html#TtEof Con4mTokenKind.TtEof -ErrorTok con4m/con4m_types.html#ErrorTok Con4mTokenKind.ErrorTok -ErrorLongComment con4m/con4m_types.html#ErrorLongComment Con4mTokenKind.ErrorLongComment -ErrorStringLit con4m/con4m_types.html#ErrorStringLit Con4mTokenKind.ErrorStringLit -Con4mTokenKind con4m/con4m_types.html#Con4mTokenKind con4m_types: Con4mTokenKind -Con4mToken con4m/con4m_types.html#Con4mToken con4m_types: Con4mToken -NodeBody con4m/con4m_types.html#NodeBody Con4mNodeKind.NodeBody -NodeAttrAssign con4m/con4m_types.html#NodeAttrAssign Con4mNodeKind.NodeAttrAssign -NodeVarAssign con4m/con4m_types.html#NodeVarAssign Con4mNodeKind.NodeVarAssign -NodeSection con4m/con4m_types.html#NodeSection Con4mNodeKind.NodeSection -NodeIfStmt con4m/con4m_types.html#NodeIfStmt Con4mNodeKind.NodeIfStmt -NodeConditional con4m/con4m_types.html#NodeConditional Con4mNodeKind.NodeConditional -NodeElse con4m/con4m_types.html#NodeElse Con4mNodeKind.NodeElse -NodeFor con4m/con4m_types.html#NodeFor Con4mNodeKind.NodeFor -NodeBreak con4m/con4m_types.html#NodeBreak Con4mNodeKind.NodeBreak -NodeContinue con4m/con4m_types.html#NodeContinue Con4mNodeKind.NodeContinue -NodeSimpLit con4m/con4m_types.html#NodeSimpLit Con4mNodeKind.NodeSimpLit -NodeUnary con4m/con4m_types.html#NodeUnary Con4mNodeKind.NodeUnary -NodeNot con4m/con4m_types.html#NodeNot Con4mNodeKind.NodeNot -NodeMember con4m/con4m_types.html#NodeMember Con4mNodeKind.NodeMember -NodeIndex con4m/con4m_types.html#NodeIndex Con4mNodeKind.NodeIndex -NodeActuals con4m/con4m_types.html#NodeActuals Con4mNodeKind.NodeActuals -NodeCall con4m/con4m_types.html#NodeCall Con4mNodeKind.NodeCall -NodeDictLit con4m/con4m_types.html#NodeDictLit Con4mNodeKind.NodeDictLit -NodeKVPair con4m/con4m_types.html#NodeKVPair Con4mNodeKind.NodeKVPair -NodeListLit con4m/con4m_types.html#NodeListLit Con4mNodeKind.NodeListLit -NodeOr con4m/con4m_types.html#NodeOr Con4mNodeKind.NodeOr -NodeAnd con4m/con4m_types.html#NodeAnd Con4mNodeKind.NodeAnd -NodeNe con4m/con4m_types.html#NodeNe Con4mNodeKind.NodeNe -NodeCmp con4m/con4m_types.html#NodeCmp Con4mNodeKind.NodeCmp -NodeGte con4m/con4m_types.html#NodeGte Con4mNodeKind.NodeGte -NodeLte con4m/con4m_types.html#NodeLte Con4mNodeKind.NodeLte -NodeGt con4m/con4m_types.html#NodeGt Con4mNodeKind.NodeGt -NodeLt con4m/con4m_types.html#NodeLt Con4mNodeKind.NodeLt -NodePlus con4m/con4m_types.html#NodePlus Con4mNodeKind.NodePlus -NodeMinus con4m/con4m_types.html#NodeMinus Con4mNodeKind.NodeMinus -NodeMod con4m/con4m_types.html#NodeMod Con4mNodeKind.NodeMod -NodeMul con4m/con4m_types.html#NodeMul Con4mNodeKind.NodeMul -NodeDiv con4m/con4m_types.html#NodeDiv Con4mNodeKind.NodeDiv -NodeEnum con4m/con4m_types.html#NodeEnum Con4mNodeKind.NodeEnum -NodeIdentifier con4m/con4m_types.html#NodeIdentifier Con4mNodeKind.NodeIdentifier -Con4mNodeKind con4m/con4m_types.html#Con4mNodeKind con4m_types: Con4mNodeKind -TypeString con4m/con4m_types.html#TypeString Con4mTypeKind.TypeString -TypeBool con4m/con4m_types.html#TypeBool Con4mTypeKind.TypeBool -TypeInt con4m/con4m_types.html#TypeInt Con4mTypeKind.TypeInt -TypeFloat con4m/con4m_types.html#TypeFloat Con4mTypeKind.TypeFloat -TypeList con4m/con4m_types.html#TypeList Con4mTypeKind.TypeList -TypeDict con4m/con4m_types.html#TypeDict Con4mTypeKind.TypeDict -TypeProc con4m/con4m_types.html#TypeProc Con4mTypeKind.TypeProc -TypeTVar con4m/con4m_types.html#TypeTVar Con4mTypeKind.TypeTVar -TypeBottom con4m/con4m_types.html#TypeBottom Con4mTypeKind.TypeBottom -Con4mTypeKind con4m/con4m_types.html#Con4mTypeKind con4m_types: Con4mTypeKind -Con4mType con4m/con4m_types.html#Con4mType con4m_types: Con4mType -Box con4m/con4m_types.html#Box con4m_types: Box -STEntry con4m/con4m_types.html#STEntry con4m_types: STEntry -Con4mScope con4m/con4m_types.html#Con4mScope con4m_types: Con4mScope -Con4mSectInfo con4m/con4m_types.html#Con4mSectInfo con4m_types: Con4mSectInfo -CurScopes con4m/con4m_types.html#CurScopes con4m_types: CurScopes -Con4mNode con4m/con4m_types.html#Con4mNode con4m_types: Con4mNode -BuiltInFn con4m/con4m_types.html#BuiltInFn con4m_types: BuiltInFn -BuiltInInfo con4m/con4m_types.html#BuiltInInfo con4m_types: BuiltInInfo -FieldValidator con4m/con4m_types.html#FieldValidator con4m_types: FieldValidator -AttrSpec con4m/con4m_types.html#AttrSpec con4m_types: AttrSpec -FieldAttrs con4m/con4m_types.html#FieldAttrs con4m_types: FieldAttrs -SectionSpec con4m/con4m_types.html#SectionSpec con4m_types: SectionSpec -ConfigSpec con4m/con4m_types.html#ConfigSpec con4m_types: ConfigSpec -SectionState con4m/con4m_types.html#SectionState con4m_types: SectionState -ConfigState con4m/con4m_types.html#ConfigState con4m_types: ConfigState -stringType con4m/con4m_types.html#stringType con4m_types: stringType -boolType con4m/con4m_types.html#boolType con4m_types: boolType -intType con4m/con4m_types.html#intType con4m_types: intType -floatType con4m/con4m_types.html#floatType con4m_types: floatType -bottomType con4m/con4m_types.html#bottomType con4m_types: bottomType -unreachable con4m/con4m_types.html#unreachable.t con4m_types: unreachable() diff --git a/docs/con4m/dollars.html b/docs/con4m/dollars.html deleted file mode 100644 index 9084cf7a..00000000 --- a/docs/con4m/dollars.html +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/dollars - - - - - - - - -
-
-

src/con4m/dollars

-
- -   Source -  Edit - -
-
- -

Functions to represent various data types as strings. For the things mapping to internal data structures, these are pretty much all just used for debugging. - -
Author:John Viega (john@crashoverride.com)
Copyright:2022
The indent field doesn't try to pretty-print unless it is set to a positive value.

-
-

Imports

-
-types -
-
-

Procs

-
-
-
proc `$`(attrs: FieldAttrs): string {....raises: [ValueError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc `$`(scope: Con4mScope; goDown = true): string {....raises: [ValueError],
-    tags: [].}
-
- -If you want to print subscopes, leave the goDown flag as true. Otherwise, set the goDown flag to false. -  Source -  Edit - -
-
-
-
proc `$`(scope: Con4mScope; indent: int): string {....raises: [ValueError],
-    tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc `$`(self: Con4mNode; i: int = 0): string {.
-    ...raises: [Exception, IOError, OSError, ValueError],
-    tags: [RootEffect, ReadIOEffect].}
-
- - -  Source -  Edit - -
-
-
-
proc `$`(spec: AttrSpec): string {....raises: [ValueError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc `$`(t: Con4mType): string {....raises: [ValueError], tags: [].}
-
- -Prints a type object the way it should be written for input, with the exception of the bottom type, which prints as its mathematical symbol () -  Source -  Edit - -
-
-
-
proc `$`(tok: Con4mToken): string {....raises: [IOError, OSError],
-                                    tags: [ReadIOEffect].}
-
- - -  Source -  Edit - -
-
-
-
proc scopeToJson(scope: Con4mScope): string {....raises: [ValueError], tags: [].}
-
- - -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/dollars.idx b/docs/con4m/dollars.idx deleted file mode 100644 index 3994a497..00000000 --- a/docs/con4m/dollars.idx +++ /dev/null @@ -1,8 +0,0 @@ -`$` con4m/dollars.html#$,Con4mToken dollars: `$`(tok: Con4mToken): string -`$` con4m/dollars.html#$,Con4mType dollars: `$`(t: Con4mType): string -`$` con4m/dollars.html#$,Con4mNode,int dollars: `$`(self: Con4mNode; i: int = 0): string -scopeToJson con4m/dollars.html#scopeToJson,Con4mScope dollars: scopeToJson(scope: Con4mScope): string -`$` con4m/dollars.html#$,Con4mScope,int dollars: `$`(scope: Con4mScope; indent: int): string -`$` con4m/dollars.html#$,Con4mScope dollars: `$`(scope: Con4mScope; goDown = true): string -`$` con4m/dollars.html#$,AttrSpec dollars: `$`(spec: AttrSpec): string -`$` con4m/dollars.html#$,FieldAttrs dollars: `$`(attrs: FieldAttrs): string diff --git a/docs/con4m/eval.html b/docs/con4m/eval.html deleted file mode 100644 index 340d1a63..00000000 --- a/docs/con4m/eval.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/eval - - - - - - - - -
-
-

src/con4m/eval

-
- -   Source -  Edit - -
-
- -

This module actually walks the tree, directly executing the operations encoded in it (as opposed to generating code that we would then run). - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

- -
-

Procs

-
-
-
proc evalConfig(filename: string): Option[(ConfigState, Con4mScope)] {.
-    ...raises: [Con4mError, IOError, OSError, Exception, KeyError, ValueError],
-    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
-
- -Given the config file as a string, this will load and parse the file, then execute it, returning both the state object created, as well as the top-level symbol table for attributes, both assuming the operation was successful. -  Source -  Edit - -
-
-
-
proc evalNode(node: Con4mNode; s: ConfigState) {....raises: [Con4mError,
-    ValueError, Exception, Exception, IOError, OSError, KeyError, Exception,
-    Con4mError], tags: [RootEffect, ReadIOEffect].}
-
- -This does the bulk of the work. Typically, it will descend into the tree to evaluate, and then take whatever action is apporpriate after, if any. -  Source -  Edit - -
-
-
-
proc evalTree(node: Con4mNode): Option[ConfigState] {.inline, ...raises: [
-    Exception, Con4mError, KeyError, ValueError, IOError, OSError, Con4mError,
-    ValueError, Exception, IOError, OSError, KeyError],
-    tags: [RootEffect, ReadIOEffect].}
-
- -This runs the evaluator on a tree that has already been parsed and type-checked. -  Source -  Edit - -
-
-
-
proc runCallback(s: ConfigState; name: string; args: seq[Box];
-                 tinfo: Option[Con4mType] = none(Con4mType)): Option[Box] {.
-    ...raises: [KeyError, Con4mError, ValueError], tags: [RootEffect].}
-
- - -  Source -  Edit - -
-
-
-
proc runtimeVarLookup(frames: VarStack; name: string; scope: Con4mScope): Box {.
-    ...raises: [KeyError, Con4mError, ValueError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc runtimeVarSet(state: ConfigState; scope: Con4mScope; name: string; val: Box) {.
-    ...raises: [Con4mError, ValueError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc sCall(s: ConfigState; name: string; a1: seq[Box]; tinfo: Con4mType;
-           nodeOpt: Option[Con4mNode] = none(Con4mNode)): Option[Box] {.
-    ...raises: [KeyError, Con4mError, ValueError], tags: [RootEffect].}
-
- -

This is not meant to be exposed outside this module, except to the evaluator. This runs a builtin call, callback or user-defined function.

-

The node parameter will be the node from the caller's scope, if present.

- -  Source -  Edit - -
-
-
-
proc stackConfig(s: ConfigState; filename: string): Option[Con4mScope] {....raises: [
-    Con4mError, IOError, OSError, Exception, KeyError, ValueError, Con4mError,
-    ValueError, Exception, IOError, OSError, KeyError],
-    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
-
- - -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/eval.idx b/docs/con4m/eval.idx deleted file mode 100644 index 063ce874..00000000 --- a/docs/con4m/eval.idx +++ /dev/null @@ -1,8 +0,0 @@ -runtimeVarLookup con4m/eval.html#runtimeVarLookup,VarStack,string,Con4mScope eval: runtimeVarLookup(frames: VarStack; name: string; scope: Con4mScope): Box -runtimeVarSet con4m/eval.html#runtimeVarSet,ConfigState,Con4mScope,string,Box eval: runtimeVarSet(state: ConfigState; scope: Con4mScope; name: string; val: Box) -sCall con4m/eval.html#sCall,ConfigState,string,seq[Box],Con4mType,Option[Con4mNode] eval: sCall(s: ConfigState; name: string; a1: seq[Box]; tinfo: Con4mType;\n nodeOpt: Option[Con4mNode] = none(Con4mNode)): Option[Box] -runCallback con4m/eval.html#runCallback,ConfigState,string,seq[Box],Option[Con4mType] eval: runCallback(s: ConfigState; name: string; args: seq[Box];\n tinfo: Option[Con4mType] = none(Con4mType)): Option[Box] -evalNode con4m/eval.html#evalNode,Con4mNode,ConfigState eval: evalNode(node: Con4mNode; s: ConfigState) -evalTree con4m/eval.html#evalTree,Con4mNode eval: evalTree(node: Con4mNode): Option[ConfigState] -evalConfig con4m/eval.html#evalConfig,string eval: evalConfig(filename: string): Option[(ConfigState, Con4mScope)] -stackConfig con4m/eval.html#stackConfig,ConfigState,string eval: stackConfig(s: ConfigState; filename: string): Option[Con4mScope] diff --git a/docs/con4m/lex.html b/docs/con4m/lex.html deleted file mode 100644 index 7fd7bb2c..00000000 --- a/docs/con4m/lex.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/lex - - - - - - - - -
-
-

src/con4m/lex

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Lexical analysis. Should be straightforward. - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

-
-

Imports

-
-types -
-
-

Procs

-
-
-
proc lex(s: Stream): (bool, seq[Con4mToken]) {....raises: [IOError, OSError],
-    tags: [ReadIOEffect].}
-
- -Lexical analysis. Doesn't need to be exported. -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/lex.idx b/docs/con4m/lex.idx deleted file mode 100644 index ed5d798f..00000000 --- a/docs/con4m/lex.idx +++ /dev/null @@ -1 +0,0 @@ -lex con4m/lex.html#lex,Stream lex: lex(s: Stream): (bool, seq[Con4mToken]) diff --git a/docs/con4m/parse.html b/docs/con4m/parse.html deleted file mode 100644 index 2c3c0119..00000000 --- a/docs/con4m/parse.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/parse - - - - - - - - -
-
-

src/con4m/parse

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

This is a simple recursive descent parser. Note that I've explicitly factored the grammar for right recursion, so in the expression grammar there is a bit of tree jockeying to get the tree to look natural. - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

- -
-

Types

-
-
-
Con4mError = object of CatchableError
-
- - -  Source -  Edit - -
-
- -
-
-

Procs

-
-
-
proc fatal(msg: string; node: Con4mNode = nil) {....raises: [Con4mError], tags: [].}
-
- -Raise a Con4mError, and add any context in the error message. -  Source -  Edit - -
-
-
-
proc fatal(msg: string; token: Con4mToken) {....raises: [Con4mError], tags: [].}
-
- -Raise a Con4mError, and add any context in the error message. -  Source -  Edit - -
-
-
-
proc parse(filename: string): Con4mNode {.
-    ...raises: [Con4mError, IOError, OSError, Con4mError, Exception],
-    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
-
- -This version takes in a file name, snarfs it up, tokenizes, then parses. -  Source -  Edit - -
-
-
-
proc parse(s: Stream; filename: string = ""): Con4mNode {.
-    ...raises: [IOError, OSError, Con4mError, Exception],
-    tags: [ReadIOEffect, RootEffect].}
-
- -This version converts a stream into tokens, then calls the parse implementation on tokens, which kicks off the actual parsing. -  Source -  Edit - -
-
-
-
proc parse(tokens: seq[Con4mToken]; filename: string): Con4mNode {.
-    ...raises: [Con4mError, Exception], tags: [RootEffect].}
-
- -This operates on tokens, as already produced by lex(). It simply kicks off the parser by entering the top-level production (body), and prints out any error message that happened during parsing. -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/parse.idx b/docs/con4m/parse.idx deleted file mode 100644 index 157db1d9..00000000 --- a/docs/con4m/parse.idx +++ /dev/null @@ -1,6 +0,0 @@ -Con4mError con4m/parse.html#Con4mError parse: Con4mError -fatal con4m/parse.html#fatal,string,Con4mToken parse: fatal(msg: string; token: Con4mToken) -fatal con4m/parse.html#fatal,string,Con4mNode parse: fatal(msg: string; node: Con4mNode = nil) -parse con4m/parse.html#parse,seq[Con4mToken],string parse: parse(tokens: seq[Con4mToken]; filename: string): Con4mNode -parse con4m/parse.html#parse,Stream,string parse: parse(s: Stream; filename: string = ""): Con4mNode -parse con4m/parse.html#parse,string parse: parse(filename: string): Con4mNode diff --git a/docs/con4m/spec.html b/docs/con4m/spec.html deleted file mode 100644 index 561b8e82..00000000 --- a/docs/con4m/spec.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/spec - - - - - - - - -
-
-

src/con4m/spec

-
- -   Source -  Edit - -
-
- -

Routines for specifying a config file schema, and for checking an executed config against that schema. - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

- -
-

Procs

-
-
-
proc addAttr(section: SectionSpec; name: string; con4mType: string;
-             default: Option[Box] = none(Box); required: bool = true;
-             lockOnWrite: bool = false; v: FieldValidator = nil;
-             doc: string = "") {....raises: [ValueError], tags: [].}
-
- -Same as globalAddAttr, except for the first parameter being the section to put the attr into, not the global state. We're going to fix this :( -  Source -  Edit - -
-
-
-
proc addGlobalAttr(spec: ConfigSpec; name: string; con4mType: string;
-                   default: Option[Box] = none(Box); required: bool = true;
-                   lockOnWrite: bool = false; v: FieldValidator = nil;
-                   doc: string = "") {....raises: [ValueError], tags: [].}
-
- -

This call specifies properties of specific attributes set in the global namespace. By default (unless you set customTopLevelOK to false when calling newConfigSpec), user-defined attributes will NOT be allowed in the global namespace. They do get user-defined variables that don't bubble up to your app, though!

-

Right now, this is the biggest wart in con4m. I was going to have there only be an addAttr() API, but the section would have to have a back-reference to the top, and I thought that would be confusing. But I think eventually that's where I'm going to go, as I don't like the irregularity.

-

The doc parameter is for doc strings, which is currently not used, but will be used down the road when we merge in supporting command-line argument handling, and start providing help messages.

- -  Source -  Edit - -
-
-
-
proc addSection(parent: SectionSpec; name: string; doc: string = "";
-                requiredSubSecs: seq[string] = @[];
-                validSubSecs: seq[string] = @[]; allowCustomAttrs: bool = false): SectionSpec {.
-    ...raises: [ValueError], tags: [].}
-
- -Same as above, but just delegates to the associatedSpec field to allow these things to be chained. -  Source -  Edit - -
-
-
-
proc addSection(spec: ConfigSpec; name: string; doc: string = "";
-                requiredSubSecs: seq[string] = @[];
-                validSubSecs: seq[string] = @[]; allowCustomAttrs: bool = false): SectionSpec {.
-    ...raises: [ValueError], tags: [].}
-
- -Adds information about the section to our specification. Note that currently, we limit section schema specs to the top-level space. That limitation will eventually change, but right now, this con4m code:
key "test" "foo" "bar" {
-
test: 10
-
-

}

-

is invalid, because the namespace for the descriptors at the start of the block is the same as the namespace for attributes inside the block. I did it this way because HCL does, then realized it's confusing AF, so instead of kludging a way to have both approaches interoperate, I decided to not implement nested sections quite yet; I'm going to come back and fix it properly by giving both concepts their own namespace, essentially.

-

But it's a lot of work, so until I prioritize it, you cannot do:

-
host "test" {
-
subsec {
-
foo : 10
-
-

}

-
-
-

}

-

Because that currently is the same as:

-
host "test" subsec {
-
foo: 10
-
-

}

-

Actually, you can do it, but it must have the same schema at the parent.

-

Currently, requiredSubSecs and validSubSecs are a list of allowed values for the sub-block descritors (the "test" "foo" "bar" above). An asterisk in one position allows anything in that position. You cannot match arbitrary lengths. Use dot notation here.

-

allowCustomAttrs can be turned on, but it's off by default, because, hey, Con4m has a separate set of variables.

-

The doc parameter is for doc strings, which is currently not used, but will be used down the road when we merge in supporting command-line argument handling, and start providing help messages.

- -  Source -  Edit - -
-
-
-
proc addSpec(s: ConfigState; spec: ConfigSpec) {....raises: [], tags: [].}
-
- -Associate a ConfigSpec object with an existing state object. -  Source -  Edit - -
-
-
-
proc getAllSectionSTs(ctx: ConfigState): Con4mSectInfo {....raises: [], tags: [].}
-
- -

Returns a sequence of tuples, one per section provided in a config file that's been read in.

-

The tuples are of the format (topsection, dotted path, scope)

-

Where scope is an object of type Con4mScope

- -  Source -  Edit - -
-
-
-
proc getConfigVar(state: ConfigState; field: string): Option[Box] {.
-    ...raises: [KeyError], tags: [].}
-
- -

This interface allows you to look up individual fields to get their value as a Box (since the config schema doesn't need to be static).

-

The contents of field use standard object dot notation.

- -  Source -  Edit - -
-
-
-
proc lockConfigVar(state: ConfigState; field: string): bool {.
-    ...raises: [KeyError], tags: [].}
-
- -This prevents the variable from being written. Returns false if the variable doesn't exist in the scope, which will generally imply a programmer error. -  Source -  Edit - -
-
-
-
proc newConfigSpec(customTopLevelOk: bool = false): ConfigSpec {....raises: [],
-    tags: [].}
-
- -

Returns a new, empty ConfigSpec object, which allows us to define a schema for our config files that we will validate after loading the file.

-

By default, the top-level section will not accept new user-defined attributes added to it. Users get variables, so generally they shouldn't need it in the top-level space.

- -  Source -  Edit - -
-
-
-
proc setOverride(state: ConfigState; field: string; value: Box): bool {.
-    ...raises: [KeyError], tags: [].}
-
- -

This indicates that, while the executing config file might be able to write to a field, some higher power (generally a command-line flag) is going to clobber with this value, as soon as execution completes.

-

Will return false if the specified variable doesn't exist in the scope, which will generally imply a programmer error.

- -  Source -  Edit - -
-
-
-
proc validateConfig(config: ConfigState): bool {.
-    ...raises: [ValueError, KeyError, Exception], tags: [RootEffect].}
-
- -

This function validates the executed configuration file against the specification set in the config variable (which you should have already set with addSpec()).

-

Note that, unlike static errors and the few possible runtime errors (currently just index out of bounds errors) this does NOT throw an exception on error. Instead, the config context will contain a list of error strings.

-

This makes it easier you to decide whether you want to error outright, or overcome the mistakes somehow, as we don't bail on our work in the middle of it.

- -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/spec.idx b/docs/con4m/spec.idx deleted file mode 100644 index 002c144b..00000000 --- a/docs/con4m/spec.idx +++ /dev/null @@ -1,11 +0,0 @@ -newConfigSpec con4m/spec.html#newConfigSpec,bool spec: newConfigSpec(customTopLevelOk: bool = false): ConfigSpec -addGlobalAttr con4m/spec.html#addGlobalAttr,ConfigSpec,string,string,Option[Box],bool,bool,FieldValidator,string spec: addGlobalAttr(spec: ConfigSpec; name: string; con4mType: string;\n default: Option[Box] = none(Box); required: bool = true;\n lockOnWrite: bool = false; v: FieldValidator = nil;\n doc: string = "") -addSection con4m/spec.html#addSection,ConfigSpec,string,string,seq[string],seq[string],bool spec: addSection(spec: ConfigSpec; name: string; doc: string = "";\n requiredSubSecs: seq[string] = @[]; validSubSecs: seq[string] = @[];\n allowCustomAttrs: bool = false): SectionSpec -addSection con4m/spec.html#addSection,SectionSpec,string,string,seq[string],seq[string],bool spec: addSection(parent: SectionSpec; name: string; doc: string = "";\n requiredSubSecs: seq[string] = @[]; validSubSecs: seq[string] = @[];\n allowCustomAttrs: bool = false): SectionSpec -addAttr con4m/spec.html#addAttr,SectionSpec,string,string,Option[Box],bool,bool,FieldValidator,string spec: addAttr(section: SectionSpec; name: string; con4mType: string;\n default: Option[Box] = none(Box); required: bool = true;\n lockOnWrite: bool = false; v: FieldValidator = nil; doc: string = "") -validateConfig con4m/spec.html#validateConfig,ConfigState spec: validateConfig(config: ConfigState): bool -getConfigVar con4m/spec.html#getConfigVar,ConfigState,string spec: getConfigVar(state: ConfigState; field: string): Option[Box] -lockConfigVar con4m/spec.html#lockConfigVar,ConfigState,string spec: lockConfigVar(state: ConfigState; field: string): bool -setOverride con4m/spec.html#setOverride,ConfigState,string,Box spec: setOverride(state: ConfigState; field: string; value: Box): bool -getAllSectionSTs con4m/spec.html#getAllSectionSTs,ConfigState spec: getAllSectionSTs(ctx: ConfigState): Con4mSectInfo -addSpec con4m/spec.html#addSpec,ConfigState,ConfigSpec spec: addSpec(s: ConfigState; spec: ConfigSpec) diff --git a/docs/con4m/st.html b/docs/con4m/st.html deleted file mode 100644 index 4e2bff51..00000000 --- a/docs/con4m/st.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/st - - - - - - - - -
-
-

src/con4m/st

-
- -   Source -  Edit - -
-
- -

The Con4m symbol table, scopes, and things that support it. This includes the helper functions for instantiating type objects.

-

The methods are all meant to be internal; the end user shouldn't directly deal with the symbol table objects.

-

The external interface should either be via macros of getConfigVar(), which lives in spec.nim just due to cross-file dependencies.

- - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

- -
-

Procs

-
-
-
proc addEntry(scope: Con4mScope; name: string;
-              firstDef: Option[Con4mNode] = none(Con4mNode);
-              tinfo = newTypeVar(); subscope: bool = false): Option[STEntry] {.
-    ...raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc dottedLookup(scope: Con4mScope; dotted: seq[string]): Option[STEntry] {.
-    ...raises: [KeyError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc getEntry(scope: Con4mScope; name: string): Option[STEntry] {.
-    ...raises: [KeyError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc lookup(scope: Con4mScope; name: string): Option[STEntry] {.
-    ...raises: [KeyError, Con4mError], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc lookupAttr(scope: Con4mScope; name: string; scopeOk: bool = false): Option[
-    STEntry] {....raises: [KeyError, Con4mError], tags: [].}
-
- -This method is exposed because it's used in the code generated automatically by our macro library. It's lower level, operating on the scope data type that doesn't get exposed from the package by default. Instead, use getConfigVar(). -  Source -  Edit - -
-
-
-
proc newDictType(keyType, valType: Con4mType): Con4mType {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc newListType(contained: Con4mType): Con4mType {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc newProcType(params: seq[Con4mType]; retType: Con4mType; va: bool = false): Con4mType {.
-    ...raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc newRootScope(): CurScopes {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc newTypeVar(constraints: set[Con4mTypeKind] = {}): Con4mType {....raises: [],
-    tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc newTypeVar(num: int): Con4mType {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc toCon4mType(s: string): Con4mType {....raises: [ValueError], tags: [].}
-
- -Converts a string to a Con4m type object. -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/st.idx b/docs/con4m/st.idx deleted file mode 100644 index ca19778d..00000000 --- a/docs/con4m/st.idx +++ /dev/null @@ -1,12 +0,0 @@ -newListType con4m/st.html#newListType,Con4mType st: newListType(contained: Con4mType): Con4mType -newDictType con4m/st.html#newDictType,Con4mType,Con4mType st: newDictType(keyType, valType: Con4mType): Con4mType -newTypeVar con4m/st.html#newTypeVar,set[Con4mTypeKind] st: newTypeVar(constraints: set[Con4mTypeKind] = {}): Con4mType -newTypeVar con4m/st.html#newTypeVar,int st: newTypeVar(num: int): Con4mType -newProcType con4m/st.html#newProcType,seq[Con4mType],Con4mType,bool st: newProcType(params: seq[Con4mType]; retType: Con4mType; va: bool = false): Con4mType -newRootScope con4m/st.html#newRootScope st: newRootScope(): CurScopes -getEntry con4m/st.html#getEntry,Con4mScope,string st: getEntry(scope: Con4mScope; name: string): Option[STEntry] -addEntry con4m/st.html#addEntry,Con4mScope,string,Option[Con4mNode],bool st: addEntry(scope: Con4mScope; name: string;\n firstDef: Option[Con4mNode] = none(Con4mNode); tinfo = newTypeVar();\n subscope: bool = false): Option[STEntry] -lookup con4m/st.html#lookup,Con4mScope,string st: lookup(scope: Con4mScope; name: string): Option[STEntry] -lookupAttr con4m/st.html#lookupAttr,Con4mScope,string,bool st: lookupAttr(scope: Con4mScope; name: string; scopeOk: bool = false): Option[\n STEntry] -dottedLookup con4m/st.html#dottedLookup,Con4mScope,seq[string] st: dottedLookup(scope: Con4mScope; dotted: seq[string]): Option[STEntry] -toCon4mType con4m/st.html#toCon4mType,string st: toCon4mType(s: string): Con4mType diff --git a/docs/con4m/treecheck.html b/docs/con4m/treecheck.html deleted file mode 100644 index b21ad188..00000000 --- a/docs/con4m/treecheck.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/treecheck - - - - - - - - -
-
-

src/con4m/treecheck

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

This module is doing three things:

  1. Type-checking the program, using the standard unifcation algorithm, which itself lives in typecheck.nim
  2. -
  3. Putting symbol tables into each node, inserting variables (and constants) into the proper symbol tables as it goes.
  4. -
  5. Setting values from string literals. Dict/list literals are done at eval time.
  6. -
- - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

- -
-

Procs

-
-
-
proc checkTree(node: Con4mNode): ConfigState {.
-    ...raises: [Exception, Con4mError, KeyError, ValueError, IOError, OSError],
-    tags: [RootEffect, ReadIOEffect].}
-
- -

Checks a parse tree rooted at node for static errors (i.e., anything we can easily find before execution). This version returns a new ConfigState object, that can be used for querying, dumped to a data structure (via our macros), or sent back to checkTree when loading a file being layered on top of what we've already read.

-

Adds all default builtins.

- -  Source -  Edit - -
-
-
-
proc checkTree(node: Con4mNode; s: ConfigState) {.
-    ...raises: [Exception, Con4mError, KeyError, ValueError, IOError, OSError],
-    tags: [RootEffect, ReadIOEffect].}
-
- -

Checks a parse tree rooted at node for static errors (i.e., anything we can easily find before execution). This version accepts an "old" ConfigState object, so that you can keep an old symbol table around, layering new choices on top of the old ones.

-

It does need to create a new variable scope though!

- -  Source -  Edit - -
-
-
-
proc getAttrScope(node: Con4mNode): Con4mScope {....raises: [], tags: [].}
-
- -Internal. Returns just the current attributes scope, when we already know it exists. -  Source -  Edit - -
-
-
-
proc getBothScopes(node: Con4mNode): CurScopes {....raises: [], tags: [].}
-
- -Internal. Returns both scopes when we know they exist. The global var scope info is also in there, even though outside a function it's part of the var scope. -  Source -  Edit - -
-
-
-
proc getTokenText(node: Con4mNode): string {.inline, ...raises: [IOError, OSError],
-    tags: [ReadIOEffect].}
-
- -This returns the raw string associated with a token. Internal. -  Source -  Edit - -
-
-
-
proc getVarScope(node: Con4mNode): Con4mScope {....raises: [], tags: [].}
-
- -Internal. Returns just the current variables scope, when we already know it exists. -  Source -  Edit - -
-
-
-
proc newConfigState(scope: Con4mScope; spec: ConfigSpec = nil;
-                    addBuiltins: bool = true): ConfigState {.
-    ...raises: [ValueError, Con4mError, KeyError, IOError, OSError, Exception], tags: [
-    WriteIOEffect, ReadEnvEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
-
- -Return a new ConfigState object, optionally setting the spec object, and, if requested via addBuiltins, installs the default set of builtin functions. -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/treecheck.idx b/docs/con4m/treecheck.idx deleted file mode 100644 index 2cea747d..00000000 --- a/docs/con4m/treecheck.idx +++ /dev/null @@ -1,7 +0,0 @@ -getTokenText con4m/treecheck.html#getTokenText,Con4mNode treecheck: getTokenText(node: Con4mNode): string -getVarScope con4m/treecheck.html#getVarScope,Con4mNode treecheck: getVarScope(node: Con4mNode): Con4mScope -getAttrScope con4m/treecheck.html#getAttrScope,Con4mNode treecheck: getAttrScope(node: Con4mNode): Con4mScope -getBothScopes con4m/treecheck.html#getBothScopes,Con4mNode treecheck: getBothScopes(node: Con4mNode): CurScopes -checkTree con4m/treecheck.html#checkTree,Con4mNode,ConfigState treecheck: checkTree(node: Con4mNode; s: ConfigState) -checkTree con4m/treecheck.html#checkTree,Con4mNode treecheck: checkTree(node: Con4mNode): ConfigState -newConfigState con4m/treecheck.html#newConfigState,Con4mScope,ConfigSpec,bool treecheck: newConfigState(scope: Con4mScope; spec: ConfigSpec = nil;\n addBuiltins: bool = true): ConfigState diff --git a/docs/con4m/typecheck.html b/docs/con4m/typecheck.html deleted file mode 100644 index f4a82eb9..00000000 --- a/docs/con4m/typecheck.html +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/typecheck - - - - - - - - -
-
-

src/con4m/typecheck

-
- -   Source -  Edit - -
-
- -

Our implementation of the good ol' unifcation algorithm, with Con4m's current type rules codified. - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

- -
-

Procs

-
-
-
proc copyType(t: Con4mType): Con4mType {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc getBaseType(node: Con4mNode): Con4mTypeKind {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc getBaseType(t: Con4mType): Con4mTypeKind {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc hasTypeVar(t: Con4mType): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isBottom(n1, n2: Con4mNode): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isBottom(n: Con4mNode): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isBottom(n: Con4mNode; t: Con4mType): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isBottom(t1, t2: Con4mType): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isBottom(t: Con4mType): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc reprSig(name: string; t: Con4mType): string {....raises: [ValueError],
-    tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc unify(n2, n1: Con4mNode): Con4mType {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc unify(param1: Con4mType; param2: Con4mType): Con4mType {.inline,
-    ...raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/typecheck.idx b/docs/con4m/typecheck.idx deleted file mode 100644 index 192a739f..00000000 --- a/docs/con4m/typecheck.idx +++ /dev/null @@ -1,12 +0,0 @@ -getBaseType con4m/typecheck.html#getBaseType,Con4mType typecheck: getBaseType(t: Con4mType): Con4mTypeKind -getBaseType con4m/typecheck.html#getBaseType,Con4mNode typecheck: getBaseType(node: Con4mNode): Con4mTypeKind -unify con4m/typecheck.html#unify,Con4mType,Con4mType typecheck: unify(param1: Con4mType; param2: Con4mType): Con4mType -isBottom con4m/typecheck.html#isBottom,Con4mType typecheck: isBottom(t: Con4mType): bool -isBottom con4m/typecheck.html#isBottom,Con4mType,Con4mType typecheck: isBottom(t1, t2: Con4mType): bool -unify con4m/typecheck.html#unify,Con4mNode,Con4mNode typecheck: unify(n2, n1: Con4mNode): Con4mType -isBottom con4m/typecheck.html#isBottom,Con4mNode typecheck: isBottom(n: Con4mNode): bool -isBottom con4m/typecheck.html#isBottom,Con4mNode,Con4mNode typecheck: isBottom(n1, n2: Con4mNode): bool -isBottom con4m/typecheck.html#isBottom,Con4mNode,Con4mType typecheck: isBottom(n: Con4mNode; t: Con4mType): bool -hasTypeVar con4m/typecheck.html#hasTypeVar,Con4mType typecheck: hasTypeVar(t: Con4mType): bool -copyType con4m/typecheck.html#copyType,Con4mType typecheck: copyType(t: Con4mType): Con4mType -reprSig con4m/typecheck.html#reprSig,string,Con4mType typecheck: reprSig(name: string; t: Con4mType): string diff --git a/docs/con4m/types.html b/docs/con4m/types.html deleted file mode 100644 index 8e4b49f0..00000000 --- a/docs/con4m/types.html +++ /dev/null @@ -1,826 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/types - - - - - - - - -
-
-

src/con4m/types

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Data types used across the project. We generally try to keep types out of this file if they're only used in one module (particularly true in macros.nim, which is all compile-time). - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

-
-

Types

-
-
-
AttrSpec = ref object
-  doc*: string
-  attrType*: string
-  validator*: Option[FieldValidator]
-  defaultVal*: Option[Box]
-  lockOnWrite*: bool
-  required*: bool
-
-
- -Internal. This is the data structure holding specification data for individual attributes, used to check for well-formed config files, to plug in defaults, ... -  Source -  Edit - -
-
-
-
BuiltInFn = ((seq[Box], Con4mScope, VarStack, Con4mScope) -> Option[Box])
-
- - -  Source -  Edit - -
-
-
-
Con4mDict[K; V] = TableRef[K, V]
-
- - -  Source -  Edit - -
-
-
-
Con4mNode = ref object
-  kind*: Con4mNodeKind
-  token*: Option[Con4mToken]
-  children*: seq[Con4mNode]
-  parent*: Option[Con4mNode]
-  typeInfo*: Con4mType
-  scopes*: Option[CurScopes]
-  formalScopes*: Option[CurScopes]
-  value*: Box
-
-
- -The actual parse tree node type. Should generally not be exposed. -  Source -  Edit - -
-
-
-
Con4mNodeKind = enum
-  NodeBody, NodeAttrAssign, NodeVarAssign, NodeUnpack, NodeSection, NodeIfStmt,
-  NodeConditional, NodeElse, NodeFor, NodeBreak, NodeContinue, NodeReturn,
-  NodeSimpLit, NodeUnary, NodeNot, NodeMember, NodeIndex, NodeActuals, NodeCall,
-  NodeDictLit, NodeKVPair, NodeListLit, NodeTupleLit, NodeOr, NodeAnd, NodeNe,
-  NodeCmp, NodeGte, NodeLte, NodeGt, NodeLt, NodePlus, NodeMinus, NodeMod,
-  NodeMul, NodeDiv, NodeEnum, NodeIdentifier, NodeFuncDef, NodeFormalList
-
- -Parse tree nodes types. Really no reason for these to be exposed either, other than the fact that they're contained in state objects that are the primary object type exposed to the user. -  Source -  Edit - -
-
-
-
Con4mScope = ref object
-  parent*: Option[Con4mScope]
-  entries*: OrderedTable[string, STEntry]
-
-
- -Internal. It represents a single scope, only containing a dictionary plus a link to out parent scope, if any. -  Source -  Edit - -
-
-
-
Con4mSectInfo = seq[(string, Con4mScope)]
-
- - -  Source -  Edit - -
-
-
-
Con4mToken = ref object
-  case kind*: Con4mTokenKind
-  of TtStringLit:
-      unescaped*: string
-
-  else:
-      nil
-
-  startPos*, endPos*, lineNo*, lineOffset*: int
-  stream*: Stream
-
-
- -Lexical tokens. Should not be exposed outside the package. -  Source -  Edit - -
-
-
-
Con4mTokenKind = enum
-  TtWhiteSpace, TtSemi, TtNewLine, TtLineComment, TtPlus, TtMinus, TtMul,
-  TtLongComment, TtDiv, TTMod, TtLte, TtLt, TtGte, TtGt, TtNeq, TtNot,
-  TtLocalAssign, TtColon, TtAttrAssign, TtCmp, TtComma, TtPeriod, TtLBrace,
-  TtRBrace, TtLBracket, TtRBracket, TtLParen, TtRParen, TtAnd, TtOr, TtIntLit,
-  TtFloatLit, TtStringLit, TtTrue, TtFalse, TtNull, TTIf, TTElIf, TTElse, TtFor,
-  TtFrom, TtTo, TtBreak, TtContinue, TtReturn, TtEnum, TtIdentifier, TtFunc,
-  TtCallback, TtSof, TtEof, ErrorTok, ErrorLongComment, ErrorStringLit
-
- - -  Source -  Edit - -
-
-
-
Con4mType = ref object
-  case kind*: Con4mTypeKind
-  of TypeTuple:
-      itemTypes*: seq[Con4mType]
-
-  of TypeList:
-      itemType*: Con4mType
-
-  of TypeDict:
-      keyType*, valType*: Con4mType
-
-  of TypeProc:
-      params*: seq[Con4mType]
-      va*: bool
-      retType*: Con4mType
-
-  of TypeTVar:
-      varNum*: int
-      link*: Option[Con4mType]
-      linksin*: seq[Con4mType]
-      cycle*: bool
-      constraints*: set[Con4mTypeKind]
-
-  else:
-    nil
-  
-
- -The internal representation of a type. Generally, you should write strings, and con4m will parse them. -  Source -  Edit - -
-
-
-
Con4mTypeKind = enum
-  TypeString, TypeBool, TypeInt, TypeFloat, TypeTuple, TypeList, TypeDict,
-  TypeProc, TypeTVar, TypeBottom
-
- -The enumeration of possible top-level types in Con4m -  Source -  Edit - -
-
-
-
ConfigSpec = ref object
-  secSpecs*: OrderedTable[string, SectionSpec]
-  globalAttrs*: FieldAttrs
-  customTopLevelOk*: bool
-
-
- -

The main user-level abstraction for holding specification data for a config file schema. Fill it with calls to addAttr(), addSection(), etc (or, better yet, through the con4m() macro).

-

The spec will be used to ensure the config file is well formed enough to work with, by comparing it against the results of execution.

- -  Source -  Edit - -
-
-
-
ConfigState = ref object
-  stateObjs*: OrderedTable[string, SectionState]
-  st*: Con4mScope
-  spec*: Option[ConfigSpec]
-  errors*: seq[string]
-  funcTable*: Table[string, seq[FuncTableEntry]]
-  funcOrigin*: bool
-  waitingForTypeInfo*: bool
-  moduleFuncDefs*: seq[FuncTableEntry]
-  moduleFuncImpls*: seq[Con4mNode]
-  secondPass*: bool
-  frames*: VarStack
-
-
- -The top-level representation of a configuration's runtime state. The symbols are in here, the specs we apply, etc. Still, the end user should not need to access the members, except via API. -  Source -  Edit - -
-
-
-
CurScopes = object
-  attrs*: Con4mScope
-  vars*: Con4mScope
-  globals*: Con4mScope
-
-
- -

At any point in a Con4m program, there are two different scopes, variable scopes (which change whenever we enter a new block like in a for loop), and attribute scopes, which nest based on sections.

-

Conceptually, the program that loads the configuration file is expected to only make use of the attributes; the variables are private to the config file's execution.

-

This helps make it easy for users to do computation, without polluting the runtime namespace, or making validation more challenging.

-

We also keep a separate record of globals, even though they are a parent of var scopes, because in user-defined functions, we are going to disallow access to global variables, so we want to be able to give good error messages.

- -  Source -  Edit - -
-
-
-
FieldAttrs = OrderedTable[string, AttrSpec]
-
- - -  Source -  Edit - -
-
-
-
FieldValidator = (seq[string], Box) -> bool
-
- - -  Source -  Edit - -
-
-
-
FnType = enum
-  FnBuiltIn, FnUserDefined, FnCallback
-
- - -  Source -  Edit - -
-
-
-
FuncTableEntry = ref object
-  tinfo*: Con4mType
-  name*: string
-  onStack*: bool
-  cannotCycle*: bool
-  locked*: bool
-  case kind*: FnType
-  of FnBuiltIn:
-      builtin*: BuiltInFn
-
-  of FnUserDefined, FnCallback:
-      impl*: Option[Con4mNode]
-
-  
-
- - -  Source -  Edit - -
-
-
-
RuntimeFrame = TableRef[string, Box]
-
- - -  Source -  Edit - -
-
-
-
SectionSpec = ref object
-  requiredSubsections*: seq[string]
-  allowedSubsections*: seq[string]
-  predefinedAttrs*: FieldAttrs
-  customAttrs*: bool
-  doc*: string
-  associatedSpec*: ConfigSpec ## Don't use this, it's only temporary to
-                              ## support having *some* code in place
-                              ## for seprately typed subsections.
-  
-
- -Internal. This holds specification data for a top-level section. -  Source -  Edit - -
-
-
-
SectionState = ref object
-  isLocked*: bool
-  substateObjs*: OrderedTable[string, SectionState]
-  beenSeen*: bool
-
-
- -Internal. This holds the overall information about a single section's evauluation state, for use primarily in checking to make sure required sections are present. -  Source -  Edit - -
-
-
-
STEntry = ref object
-  tInfo*: Con4mType
-  value*: Option[Box] ## Note that local variables are not stored in an
-                      ## STEntry during execution.  Before execution, this
-                      ## value can hold default values.
-                      ## 
-                      ## Attribute scopes persist though, so we *do* use this
-                      ## variable at runtime for attributes.
-  override*: Option[Box]     ## If a command-line flag or the program set this
-                             ## value at runtime, then it will automatically be
-                             ## re-set after the configuration file loads.
-  subscope*: Option[Con4mScope]
-  firstDef*: Option[Con4mNode]
-  locked*: bool
-
-
- -Internal; our symbol table data structure. -  Source -  Edit - -
-
-
-
VarStack = seq[RuntimeFrame]
-
- - -  Source -  Edit - -
-
- -
-
-

Lets

-
-
-
boolType = Con4mType(kind: TypeBool)
-
- - -  Source -  Edit - -
-
-
-
bottomType = Con4mType(kind: TypeBottom)
-
- - -  Source -  Edit - -
-
-
-
floatType = Con4mType(kind: TypeFloat)
-
- - -  Source -  Edit - -
-
-
-
intType = Con4mType(kind: TypeInt)
-
- - -  Source -  Edit - -
-
-
-
stringType = Con4mType(kind: TypeString)
-
- - -  Source -  Edit - -
-
- -
-
-

Procs

-
-
-
proc newCon4mDict[K, V](): Con4mDict[K, V] {.inline.}
-
- - -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/types.idx b/docs/con4m/types.idx deleted file mode 100644 index c99ccc8c..00000000 --- a/docs/con4m/types.idx +++ /dev/null @@ -1,136 +0,0 @@ -TtWhiteSpace con4m/types.html#TtWhiteSpace Con4mTokenKind.TtWhiteSpace -TtSemi con4m/types.html#TtSemi Con4mTokenKind.TtSemi -TtNewLine con4m/types.html#TtNewLine Con4mTokenKind.TtNewLine -TtLineComment con4m/types.html#TtLineComment Con4mTokenKind.TtLineComment -TtPlus con4m/types.html#TtPlus Con4mTokenKind.TtPlus -TtMinus con4m/types.html#TtMinus Con4mTokenKind.TtMinus -TtMul con4m/types.html#TtMul Con4mTokenKind.TtMul -TtLongComment con4m/types.html#TtLongComment Con4mTokenKind.TtLongComment -TtDiv con4m/types.html#TtDiv Con4mTokenKind.TtDiv -TTMod con4m/types.html#TTMod Con4mTokenKind.TTMod -TtLte con4m/types.html#TtLte Con4mTokenKind.TtLte -TtLt con4m/types.html#TtLt Con4mTokenKind.TtLt -TtGte con4m/types.html#TtGte Con4mTokenKind.TtGte -TtGt con4m/types.html#TtGt Con4mTokenKind.TtGt -TtNeq con4m/types.html#TtNeq Con4mTokenKind.TtNeq -TtNot con4m/types.html#TtNot Con4mTokenKind.TtNot -TtLocalAssign con4m/types.html#TtLocalAssign Con4mTokenKind.TtLocalAssign -TtColon con4m/types.html#TtColon Con4mTokenKind.TtColon -TtAttrAssign con4m/types.html#TtAttrAssign Con4mTokenKind.TtAttrAssign -TtCmp con4m/types.html#TtCmp Con4mTokenKind.TtCmp -TtComma con4m/types.html#TtComma Con4mTokenKind.TtComma -TtPeriod con4m/types.html#TtPeriod Con4mTokenKind.TtPeriod -TtLBrace con4m/types.html#TtLBrace Con4mTokenKind.TtLBrace -TtRBrace con4m/types.html#TtRBrace Con4mTokenKind.TtRBrace -TtLBracket con4m/types.html#TtLBracket Con4mTokenKind.TtLBracket -TtRBracket con4m/types.html#TtRBracket Con4mTokenKind.TtRBracket -TtLParen con4m/types.html#TtLParen Con4mTokenKind.TtLParen -TtRParen con4m/types.html#TtRParen Con4mTokenKind.TtRParen -TtAnd con4m/types.html#TtAnd Con4mTokenKind.TtAnd -TtOr con4m/types.html#TtOr Con4mTokenKind.TtOr -TtIntLit con4m/types.html#TtIntLit Con4mTokenKind.TtIntLit -TtFloatLit con4m/types.html#TtFloatLit Con4mTokenKind.TtFloatLit -TtStringLit con4m/types.html#TtStringLit Con4mTokenKind.TtStringLit -TtTrue con4m/types.html#TtTrue Con4mTokenKind.TtTrue -TtFalse con4m/types.html#TtFalse Con4mTokenKind.TtFalse -TtNull con4m/types.html#TtNull Con4mTokenKind.TtNull -TTIf con4m/types.html#TTIf Con4mTokenKind.TTIf -TTElIf con4m/types.html#TTElIf Con4mTokenKind.TTElIf -TTElse con4m/types.html#TTElse Con4mTokenKind.TTElse -TtFor con4m/types.html#TtFor Con4mTokenKind.TtFor -TtFrom con4m/types.html#TtFrom Con4mTokenKind.TtFrom -TtTo con4m/types.html#TtTo Con4mTokenKind.TtTo -TtBreak con4m/types.html#TtBreak Con4mTokenKind.TtBreak -TtContinue con4m/types.html#TtContinue Con4mTokenKind.TtContinue -TtReturn con4m/types.html#TtReturn Con4mTokenKind.TtReturn -TtEnum con4m/types.html#TtEnum Con4mTokenKind.TtEnum -TtIdentifier con4m/types.html#TtIdentifier Con4mTokenKind.TtIdentifier -TtFunc con4m/types.html#TtFunc Con4mTokenKind.TtFunc -TtCallback con4m/types.html#TtCallback Con4mTokenKind.TtCallback -TtSof con4m/types.html#TtSof Con4mTokenKind.TtSof -TtEof con4m/types.html#TtEof Con4mTokenKind.TtEof -ErrorTok con4m/types.html#ErrorTok Con4mTokenKind.ErrorTok -ErrorLongComment con4m/types.html#ErrorLongComment Con4mTokenKind.ErrorLongComment -ErrorStringLit con4m/types.html#ErrorStringLit Con4mTokenKind.ErrorStringLit -Con4mTokenKind con4m/types.html#Con4mTokenKind types: Con4mTokenKind -Con4mToken con4m/types.html#Con4mToken types: Con4mToken -NodeBody con4m/types.html#NodeBody Con4mNodeKind.NodeBody -NodeAttrAssign con4m/types.html#NodeAttrAssign Con4mNodeKind.NodeAttrAssign -NodeVarAssign con4m/types.html#NodeVarAssign Con4mNodeKind.NodeVarAssign -NodeUnpack con4m/types.html#NodeUnpack Con4mNodeKind.NodeUnpack -NodeSection con4m/types.html#NodeSection Con4mNodeKind.NodeSection -NodeIfStmt con4m/types.html#NodeIfStmt Con4mNodeKind.NodeIfStmt -NodeConditional con4m/types.html#NodeConditional Con4mNodeKind.NodeConditional -NodeElse con4m/types.html#NodeElse Con4mNodeKind.NodeElse -NodeFor con4m/types.html#NodeFor Con4mNodeKind.NodeFor -NodeBreak con4m/types.html#NodeBreak Con4mNodeKind.NodeBreak -NodeContinue con4m/types.html#NodeContinue Con4mNodeKind.NodeContinue -NodeReturn con4m/types.html#NodeReturn Con4mNodeKind.NodeReturn -NodeSimpLit con4m/types.html#NodeSimpLit Con4mNodeKind.NodeSimpLit -NodeUnary con4m/types.html#NodeUnary Con4mNodeKind.NodeUnary -NodeNot con4m/types.html#NodeNot Con4mNodeKind.NodeNot -NodeMember con4m/types.html#NodeMember Con4mNodeKind.NodeMember -NodeIndex con4m/types.html#NodeIndex Con4mNodeKind.NodeIndex -NodeActuals con4m/types.html#NodeActuals Con4mNodeKind.NodeActuals -NodeCall con4m/types.html#NodeCall Con4mNodeKind.NodeCall -NodeDictLit con4m/types.html#NodeDictLit Con4mNodeKind.NodeDictLit -NodeKVPair con4m/types.html#NodeKVPair Con4mNodeKind.NodeKVPair -NodeListLit con4m/types.html#NodeListLit Con4mNodeKind.NodeListLit -NodeTupleLit con4m/types.html#NodeTupleLit Con4mNodeKind.NodeTupleLit -NodeOr con4m/types.html#NodeOr Con4mNodeKind.NodeOr -NodeAnd con4m/types.html#NodeAnd Con4mNodeKind.NodeAnd -NodeNe con4m/types.html#NodeNe Con4mNodeKind.NodeNe -NodeCmp con4m/types.html#NodeCmp Con4mNodeKind.NodeCmp -NodeGte con4m/types.html#NodeGte Con4mNodeKind.NodeGte -NodeLte con4m/types.html#NodeLte Con4mNodeKind.NodeLte -NodeGt con4m/types.html#NodeGt Con4mNodeKind.NodeGt -NodeLt con4m/types.html#NodeLt Con4mNodeKind.NodeLt -NodePlus con4m/types.html#NodePlus Con4mNodeKind.NodePlus -NodeMinus con4m/types.html#NodeMinus Con4mNodeKind.NodeMinus -NodeMod con4m/types.html#NodeMod Con4mNodeKind.NodeMod -NodeMul con4m/types.html#NodeMul Con4mNodeKind.NodeMul -NodeDiv con4m/types.html#NodeDiv Con4mNodeKind.NodeDiv -NodeEnum con4m/types.html#NodeEnum Con4mNodeKind.NodeEnum -NodeIdentifier con4m/types.html#NodeIdentifier Con4mNodeKind.NodeIdentifier -NodeFuncDef con4m/types.html#NodeFuncDef Con4mNodeKind.NodeFuncDef -NodeFormalList con4m/types.html#NodeFormalList Con4mNodeKind.NodeFormalList -Con4mNodeKind con4m/types.html#Con4mNodeKind types: Con4mNodeKind -TypeString con4m/types.html#TypeString Con4mTypeKind.TypeString -TypeBool con4m/types.html#TypeBool Con4mTypeKind.TypeBool -TypeInt con4m/types.html#TypeInt Con4mTypeKind.TypeInt -TypeFloat con4m/types.html#TypeFloat Con4mTypeKind.TypeFloat -TypeTuple con4m/types.html#TypeTuple Con4mTypeKind.TypeTuple -TypeList con4m/types.html#TypeList Con4mTypeKind.TypeList -TypeDict con4m/types.html#TypeDict Con4mTypeKind.TypeDict -TypeProc con4m/types.html#TypeProc Con4mTypeKind.TypeProc -TypeTVar con4m/types.html#TypeTVar Con4mTypeKind.TypeTVar -TypeBottom con4m/types.html#TypeBottom Con4mTypeKind.TypeBottom -Con4mTypeKind con4m/types.html#Con4mTypeKind types: Con4mTypeKind -Con4mType con4m/types.html#Con4mType types: Con4mType -Con4mDict con4m/types.html#Con4mDict types: Con4mDict -STEntry con4m/types.html#STEntry types: STEntry -RuntimeFrame con4m/types.html#RuntimeFrame types: RuntimeFrame -VarStack con4m/types.html#VarStack types: VarStack -Con4mScope con4m/types.html#Con4mScope types: Con4mScope -Con4mSectInfo con4m/types.html#Con4mSectInfo types: Con4mSectInfo -CurScopes con4m/types.html#CurScopes types: CurScopes -Con4mNode con4m/types.html#Con4mNode types: Con4mNode -BuiltInFn con4m/types.html#BuiltInFn types: BuiltInFn -FnBuiltIn con4m/types.html#FnBuiltIn FnType.FnBuiltIn -FnUserDefined con4m/types.html#FnUserDefined FnType.FnUserDefined -FnCallback con4m/types.html#FnCallback FnType.FnCallback -FnType con4m/types.html#FnType types: FnType -FuncTableEntry con4m/types.html#FuncTableEntry types: FuncTableEntry -FieldValidator con4m/types.html#FieldValidator types: FieldValidator -AttrSpec con4m/types.html#AttrSpec types: AttrSpec -FieldAttrs con4m/types.html#FieldAttrs types: FieldAttrs -SectionSpec con4m/types.html#SectionSpec types: SectionSpec -ConfigSpec con4m/types.html#ConfigSpec types: ConfigSpec -SectionState con4m/types.html#SectionState types: SectionState -ConfigState con4m/types.html#ConfigState types: ConfigState -stringType con4m/types.html#stringType types: stringType -boolType con4m/types.html#boolType types: boolType -intType con4m/types.html#intType types: intType -floatType con4m/types.html#floatType types: floatType -bottomType con4m/types.html#bottomType types: bottomType -newCon4mDict con4m/types.html#newCon4mDict types: newCon4mDict[K, V](): Con4mDict[K, V] diff --git a/docs/con4m/unicodeident.html b/docs/con4m/unicodeident.html deleted file mode 100644 index 1df636c6..00000000 --- a/docs/con4m/unicodeident.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - - - - - - - - - - - - -src/con4m/unicodeident - - - - - - - - -
-
-

src/con4m/unicodeident

-
-
-
- -     Dark Mode -
- -
- Search: -
-
- Group by: - -
- - -
-   Source -  Edit - -
-
- -

Nim is actually very flexible on identifiers; too flexible! Our lexer accepts based on the Unicode standard for identifiers. Unfortunately, neither Nim itself or the unicode character database package implements this check, so we do it ourselves.

-

The end user should never see this in the context of con4m though.

- - -
Author:John Viega (john@crashoverride.com)
Copyright:2022

-
-

Procs

-
-
-
proc isIdContinue(r: Rune): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isIdStart(r: Rune; underscoreOk: bool = true): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isOtherIdContinue(r: Rune): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isOtherIdStart(r: Rune): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isPatternSyntax(r: Rune): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isPatternWhiteSpace(r: Rune): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc isValidId(s: string): bool {....raises: [], tags: [].}
-
- - -  Source -  Edit - -
-
-
-
proc peekRune(s: Stream): Rune {....raises: [IOError, OSError],
-                                 tags: [ReadIOEffect].}
-
- - -  Source -  Edit - -
-
-
-
proc readRune(s: Stream): Rune {....raises: [IOError, OSError],
-                                 tags: [ReadIOEffect].}
-
- - -  Source -  Edit - -
-
- -
- -
-
- -
- -
-
-
- - - diff --git a/docs/con4m/unicodeident.idx b/docs/con4m/unicodeident.idx deleted file mode 100644 index 4ae3b6be..00000000 --- a/docs/con4m/unicodeident.idx +++ /dev/null @@ -1,9 +0,0 @@ -isPatternSyntax con4m/unicodeident.html#isPatternSyntax,Rune unicodeident: isPatternSyntax(r: Rune): bool -isPatternWhiteSpace con4m/unicodeident.html#isPatternWhiteSpace,Rune unicodeident: isPatternWhiteSpace(r: Rune): bool -isOtherIdStart con4m/unicodeident.html#isOtherIdStart,Rune unicodeident: isOtherIdStart(r: Rune): bool -isOtherIdContinue con4m/unicodeident.html#isOtherIdContinue,Rune unicodeident: isOtherIdContinue(r: Rune): bool -isIdStart con4m/unicodeident.html#isIdStart,Rune,bool unicodeident: isIdStart(r: Rune; underscoreOk: bool = true): bool -isIdContinue con4m/unicodeident.html#isIdContinue,Rune unicodeident: isIdContinue(r: Rune): bool -isValidId con4m/unicodeident.html#isValidId,string unicodeident: isValidId(s: string): bool -readRune con4m/unicodeident.html#readRune,Stream unicodeident: readRune(s: Stream): Rune -peekRune con4m/unicodeident.html#peekRune,Stream unicodeident: peekRune(s: Stream): Rune diff --git a/docs/dochack.js b/docs/dochack.js deleted file mode 100644 index f9b43e83..00000000 --- a/docs/dochack.js +++ /dev/null @@ -1,2041 +0,0 @@ -/* Generated by the Nim Compiler v1.6.10 */ -var framePtr = null; -var excHandler = 0; -var lastJSError = null; -var NTI620757006 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; -var NTI469762606 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979899 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979898 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979897 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979896 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979895 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979894 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979893 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979892 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979891 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979890 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979889 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979888 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979887 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979886 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979885 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979884 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979883 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979882 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979881 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979880 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979879 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979878 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979877 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979876 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979781 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979825 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979824 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979964 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979961 = {size: 0,kind: 25,base: null,node: null,finalizer: null}; -var NTI603979960 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; -var NTI603979873 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979963 = {size: 0, kind: 18, base: null, node: null, finalizer: null}; -var NTI603979874 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979813 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979812 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979925 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979815 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979814 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979924 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979923 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979823 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979822 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979922 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979921 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979817 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979816 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979920 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979927 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979819 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979818 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979926 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI33554456 = {size: 0,kind: 31,base: null,node: null,finalizer: null}; -var NTI603979930 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979821 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979820 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI33554466 = {size: 0,kind: 1,base: null,node: null,finalizer: null}; -var NTI603979794 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979793 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979801 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979800 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979799 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979798 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603979795 = {size: 0, kind: 14, base: null, node: null, finalizer: null}; -var NTI603979919 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979918 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979917 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI603979797 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI603979796 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI603980220 = {size: 0, kind: 24, base: null, node: null, finalizer: null}; -var NTI33555124 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI33555128 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI33555130 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI33555083 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI33555165 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI33554439 = {size: 0,kind: 28,base: null,node: null,finalizer: null}; -var NTI33554440 = {size: 0,kind: 29,base: null,node: null,finalizer: null}; -var NTI33555164 = {size: 0, kind: 22, base: null, node: null, finalizer: null}; -var NTI33555112 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI33555113 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI33555120 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NTI33555122 = {size: 0, kind: 17, base: null, node: null, finalizer: null}; -var NNI33555122 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI33555122.node = NNI33555122; -var NNI33555120 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI33555120.node = NNI33555120; -var NNI33555113 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI33555113.node = NNI33555113; -NTI33555164.base = NTI33555112; -NTI33555165.base = NTI33555112; -var NNI33555112 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI33555164, name: "parent", sons: null}, -{kind: 1, offset: "name", len: 0, typ: NTI33554440, name: "name", sons: null}, -{kind: 1, offset: "message", len: 0, typ: NTI33554439, name: "msg", sons: null}, -{kind: 1, offset: "trace", len: 0, typ: NTI33554439, name: "trace", sons: null}, -{kind: 1, offset: "up", len: 0, typ: NTI33555165, name: "up", sons: null}]}; -NTI33555112.node = NNI33555112; -var NNI33555083 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI33555083.node = NNI33555083; -NTI33555112.base = NTI33555083; -NTI33555113.base = NTI33555112; -NTI33555120.base = NTI33555113; -NTI33555122.base = NTI33555120; -var NNI33555130 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI33555130.node = NNI33555130; -NTI33555130.base = NTI33555113; -var NNI33555128 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI33555128.node = NNI33555128; -NTI33555128.base = NTI33555113; -var NNI33555124 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI33555124.node = NNI33555124; -NTI33555124.base = NTI33555113; -NTI603979917.base = NTI603979796; -NTI603979918.base = NTI603979796; -NTI603979919.base = NTI603979796; -var NNI603979795 = {kind: 2, offset: 0, typ: null, name: null, len: 12, sons: {"1": {kind: 1, offset: 1, typ: NTI603979795, name: "ElementNode", len: 0, sons: null}, -"2": {kind: 1, offset: 2, typ: NTI603979795, name: "AttributeNode", len: 0, sons: null}, -"3": {kind: 1, offset: 3, typ: NTI603979795, name: "TextNode", len: 0, sons: null}, -"4": {kind: 1, offset: 4, typ: NTI603979795, name: "CDATANode", len: 0, sons: null}, -"5": {kind: 1, offset: 5, typ: NTI603979795, name: "EntityRefNode", len: 0, sons: null}, -"6": {kind: 1, offset: 6, typ: NTI603979795, name: "EntityNode", len: 0, sons: null}, -"7": {kind: 1, offset: 7, typ: NTI603979795, name: "ProcessingInstructionNode", len: 0, sons: null}, -"8": {kind: 1, offset: 8, typ: NTI603979795, name: "CommentNode", len: 0, sons: null}, -"9": {kind: 1, offset: 9, typ: NTI603979795, name: "DocumentNode", len: 0, sons: null}, -"10": {kind: 1, offset: 10, typ: NTI603979795, name: "DocumentTypeNode", len: 0, sons: null}, -"11": {kind: 1, offset: 11, typ: NTI603979795, name: "DocumentFragmentNode", len: 0, sons: null}, -"12": {kind: 1, offset: 12, typ: NTI603979795, name: "NotationNode", len: 0, sons: null}}}; -NTI603979795.node = NNI603979795; -var NNI603979794 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []}; -NTI603979794.node = NNI603979794; -NTI603979794.base = NTI33555083; -NTI603979793.base = NTI603979794; -NTI603979930.base = NTI603979800; -var NNI603979821 = {kind: 2, len: 10, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "acceptCharset", len: 0, typ: NTI33554440, name: "acceptCharset", sons: null}, -{kind: 1, offset: "action", len: 0, typ: NTI33554440, name: "action", sons: null}, -{kind: 1, offset: "autocomplete", len: 0, typ: NTI33554440, name: "autocomplete", sons: null}, -{kind: 1, offset: "elements", len: 0, typ: NTI603979930, name: "elements", sons: null}, -{kind: 1, offset: "encoding", len: 0, typ: NTI33554440, name: "encoding", sons: null}, -{kind: 1, offset: "enctype", len: 0, typ: NTI33554440, name: "enctype", sons: null}, -{kind: 1, offset: "length", len: 0, typ: NTI33554456, name: "length", sons: null}, -{kind: 1, offset: "method", len: 0, typ: NTI33554440, name: "method", sons: null}, -{kind: 1, offset: "noValidate", len: 0, typ: NTI33554466, name: "noValidate", sons: null}, -{kind: 1, offset: "target", len: 0, typ: NTI33554440, name: "target", sons: null}]}; -NTI603979821.node = NNI603979821; -NTI603979821.base = NTI603979801; -NTI603979820.base = NTI603979821; -var NNI603979819 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "defaultSelected", len: 0, typ: NTI33554466, name: "defaultSelected", sons: null}, -{kind: 1, offset: "selected", len: 0, typ: NTI33554466, name: "selected", sons: null}, -{kind: 1, offset: "selectedIndex", len: 0, typ: NTI33554456, name: "selectedIndex", sons: null}, -{kind: 1, offset: "text", len: 0, typ: NTI33554440, name: "text", sons: null}, -{kind: 1, offset: "value", len: 0, typ: NTI33554440, name: "value", sons: null}]}; -NTI603979819.node = NNI603979819; -NTI603979819.base = NTI603979801; -NTI603979818.base = NTI603979819; -NTI603979926.base = NTI603979818; -NTI603979927.base = NTI603979818; -var NNI603979801 = {kind: 2, len: 20, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "className", len: 0, typ: NTI33554440, name: "className", sons: null}, -{kind: 1, offset: "classList", len: 0, typ: NTI603979793, name: "classList", sons: null}, -{kind: 1, offset: "checked", len: 0, typ: NTI33554466, name: "checked", sons: null}, -{kind: 1, offset: "defaultChecked", len: 0, typ: NTI33554466, name: "defaultChecked", sons: null}, -{kind: 1, offset: "defaultValue", len: 0, typ: NTI33554440, name: "defaultValue", sons: null}, -{kind: 1, offset: "disabled", len: 0, typ: NTI33554466, name: "disabled", sons: null}, -{kind: 1, offset: "form", len: 0, typ: NTI603979820, name: "form", sons: null}, -{kind: 1, offset: "name", len: 0, typ: NTI33554440, name: "name", sons: null}, -{kind: 1, offset: "readOnly", len: 0, typ: NTI33554466, name: "readOnly", sons: null}, -{kind: 1, offset: "options", len: 0, typ: NTI603979926, name: "options", sons: null}, -{kind: 1, offset: "selectedOptions", len: 0, typ: NTI603979927, name: "selectedOptions", sons: null}, -{kind: 1, offset: "clientWidth", len: 0, typ: NTI33554456, name: "clientWidth", sons: null}, -{kind: 1, offset: "clientHeight", len: 0, typ: NTI33554456, name: "clientHeight", sons: null}, -{kind: 1, offset: "contentEditable", len: 0, typ: NTI33554440, name: "contentEditable", sons: null}, -{kind: 1, offset: "isContentEditable", len: 0, typ: NTI33554466, name: "isContentEditable", sons: null}, -{kind: 1, offset: "dir", len: 0, typ: NTI33554440, name: "dir", sons: null}, -{kind: 1, offset: "offsetHeight", len: 0, typ: NTI33554456, name: "offsetHeight", sons: null}, -{kind: 1, offset: "offsetWidth", len: 0, typ: NTI33554456, name: "offsetWidth", sons: null}, -{kind: 1, offset: "offsetLeft", len: 0, typ: NTI33554456, name: "offsetLeft", sons: null}, -{kind: 1, offset: "offsetTop", len: 0, typ: NTI33554456, name: "offsetTop", sons: null}]}; -NTI603979801.node = NNI603979801; -NTI603979801.base = NTI603979797; -NTI603979800.base = NTI603979801; -var NNI603979817 = {kind: 2, len: 3, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "text", len: 0, typ: NTI33554440, name: "text", sons: null}, -{kind: 1, offset: "x", len: 0, typ: NTI33554456, name: "x", sons: null}, -{kind: 1, offset: "y", len: 0, typ: NTI33554456, name: "y", sons: null}]}; -NTI603979817.node = NNI603979817; -NTI603979817.base = NTI603979801; -NTI603979816.base = NTI603979817; -NTI603979920.base = NTI603979816; -NTI603979921.base = NTI603979820; -var NNI603979823 = {kind: 2, len: 8, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "border", len: 0, typ: NTI33554456, name: "border", sons: null}, -{kind: 1, offset: "complete", len: 0, typ: NTI33554466, name: "complete", sons: null}, -{kind: 1, offset: "height", len: 0, typ: NTI33554456, name: "height", sons: null}, -{kind: 1, offset: "hspace", len: 0, typ: NTI33554456, name: "hspace", sons: null}, -{kind: 1, offset: "lowsrc", len: 0, typ: NTI33554440, name: "lowsrc", sons: null}, -{kind: 1, offset: "src", len: 0, typ: NTI33554440, name: "src", sons: null}, -{kind: 1, offset: "vspace", len: 0, typ: NTI33554456, name: "vspace", sons: null}, -{kind: 1, offset: "width", len: 0, typ: NTI33554456, name: "width", sons: null}]}; -NTI603979823.node = NNI603979823; -NTI603979823.base = NTI603979801; -NTI603979822.base = NTI603979823; -NTI603979922.base = NTI603979822; -NTI603979923.base = NTI603979800; -var NNI603979815 = {kind: 2, len: 6, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "height", len: 0, typ: NTI33554456, name: "height", sons: null}, -{kind: 1, offset: "hspace", len: 0, typ: NTI33554456, name: "hspace", sons: null}, -{kind: 1, offset: "src", len: 0, typ: NTI33554440, name: "src", sons: null}, -{kind: 1, offset: "width", len: 0, typ: NTI33554456, name: "width", sons: null}, -{kind: 1, offset: "type", len: 0, typ: NTI33554440, name: "type", sons: null}, -{kind: 1, offset: "vspace", len: 0, typ: NTI33554456, name: "vspace", sons: null}]}; -NTI603979815.node = NNI603979815; -NTI603979815.base = NTI603979801; -NTI603979814.base = NTI603979815; -NTI603979924.base = NTI603979814; -var NNI603979813 = {kind: 2, len: 4, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "target", len: 0, typ: NTI33554440, name: "target", sons: null}, -{kind: 1, offset: "text", len: 0, typ: NTI33554440, name: "text", sons: null}, -{kind: 1, offset: "x", len: 0, typ: NTI33554456, name: "x", sons: null}, -{kind: 1, offset: "y", len: 0, typ: NTI33554456, name: "y", sons: null}]}; -NTI603979813.node = NNI603979813; -NTI603979813.base = NTI603979801; -NTI603979812.base = NTI603979813; -NTI603979925.base = NTI603979812; -var NNI603979960 = {kind: 1, offset: "then", len: 0, typ: NTI603979961, name: "then", sons: null}; -NTI603979960.node = NNI603979960; -NTI603979873.base = NTI603979960; -var NNI603979963 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "ready", len: 0, typ: NTI603979873, name: "ready", sons: null}, -{kind: 1, offset: "onloadingdone", len: 0, typ: NTI603979964, name: "onloadingdone", sons: null}]}; -NTI603979963.node = NNI603979963; -NTI603979874.base = NTI603979963; -var NNI603979799 = {kind: 2, len: 23, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "activeElement", len: 0, typ: NTI603979800, name: "activeElement", sons: null}, -{kind: 1, offset: "documentElement", len: 0, typ: NTI603979800, name: "documentElement", sons: null}, -{kind: 1, offset: "alinkColor", len: 0, typ: NTI33554440, name: "alinkColor", sons: null}, -{kind: 1, offset: "bgColor", len: 0, typ: NTI33554440, name: "bgColor", sons: null}, -{kind: 1, offset: "body", len: 0, typ: NTI603979800, name: "body", sons: null}, -{kind: 1, offset: "charset", len: 0, typ: NTI33554440, name: "charset", sons: null}, -{kind: 1, offset: "cookie", len: 0, typ: NTI33554440, name: "cookie", sons: null}, -{kind: 1, offset: "defaultCharset", len: 0, typ: NTI33554440, name: "defaultCharset", sons: null}, -{kind: 1, offset: "fgColor", len: 0, typ: NTI33554440, name: "fgColor", sons: null}, -{kind: 1, offset: "head", len: 0, typ: NTI603979800, name: "head", sons: null}, -{kind: 1, offset: "lastModified", len: 0, typ: NTI33554440, name: "lastModified", sons: null}, -{kind: 1, offset: "linkColor", len: 0, typ: NTI33554440, name: "linkColor", sons: null}, -{kind: 1, offset: "referrer", len: 0, typ: NTI33554440, name: "referrer", sons: null}, -{kind: 1, offset: "title", len: 0, typ: NTI33554440, name: "title", sons: null}, -{kind: 1, offset: "URL", len: 0, typ: NTI33554440, name: "URL", sons: null}, -{kind: 1, offset: "vlinkColor", len: 0, typ: NTI33554440, name: "vlinkColor", sons: null}, -{kind: 1, offset: "anchors", len: 0, typ: NTI603979920, name: "anchors", sons: null}, -{kind: 1, offset: "forms", len: 0, typ: NTI603979921, name: "forms", sons: null}, -{kind: 1, offset: "images", len: 0, typ: NTI603979922, name: "images", sons: null}, -{kind: 1, offset: "applets", len: 0, typ: NTI603979923, name: "applets", sons: null}, -{kind: 1, offset: "embeds", len: 0, typ: NTI603979924, name: "embeds", sons: null}, -{kind: 1, offset: "links", len: 0, typ: NTI603979925, name: "links", sons: null}, -{kind: 1, offset: "fonts", len: 0, typ: NTI603979874, name: "fonts", sons: null}]}; -NTI603979799.node = NNI603979799; -NTI603979799.base = NTI603979797; -NTI603979798.base = NTI603979799; -var NNI603979825 = {kind: 2, len: 368, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "alignContent", len: 0, typ: NTI33554440, name: "alignContent", sons: null}, -{kind: 1, offset: "alignItems", len: 0, typ: NTI33554440, name: "alignItems", sons: null}, -{kind: 1, offset: "alignSelf", len: 0, typ: NTI33554440, name: "alignSelf", sons: null}, -{kind: 1, offset: "all", len: 0, typ: NTI33554440, name: "all", sons: null}, -{kind: 1, offset: "animation", len: 0, typ: NTI33554440, name: "animation", sons: null}, -{kind: 1, offset: "animationDelay", len: 0, typ: NTI33554440, name: "animationDelay", sons: null}, -{kind: 1, offset: "animationDirection", len: 0, typ: NTI33554440, name: "animationDirection", sons: null}, -{kind: 1, offset: "animationDuration", len: 0, typ: NTI33554440, name: "animationDuration", sons: null}, -{kind: 1, offset: "animationFillMode", len: 0, typ: NTI33554440, name: "animationFillMode", sons: null}, -{kind: 1, offset: "animationIterationCount", len: 0, typ: NTI33554440, name: "animationIterationCount", sons: null}, -{kind: 1, offset: "animationName", len: 0, typ: NTI33554440, name: "animationName", sons: null}, -{kind: 1, offset: "animationPlayState", len: 0, typ: NTI33554440, name: "animationPlayState", sons: null}, -{kind: 1, offset: "animationTimingFunction", len: 0, typ: NTI33554440, name: "animationTimingFunction", sons: null}, -{kind: 1, offset: "backdropFilter", len: 0, typ: NTI33554440, name: "backdropFilter", sons: null}, -{kind: 1, offset: "backfaceVisibility", len: 0, typ: NTI33554440, name: "backfaceVisibility", sons: null}, -{kind: 1, offset: "background", len: 0, typ: NTI33554440, name: "background", sons: null}, -{kind: 1, offset: "backgroundAttachment", len: 0, typ: NTI33554440, name: "backgroundAttachment", sons: null}, -{kind: 1, offset: "backgroundBlendMode", len: 0, typ: NTI33554440, name: "backgroundBlendMode", sons: null}, -{kind: 1, offset: "backgroundClip", len: 0, typ: NTI33554440, name: "backgroundClip", sons: null}, -{kind: 1, offset: "backgroundColor", len: 0, typ: NTI33554440, name: "backgroundColor", sons: null}, -{kind: 1, offset: "backgroundImage", len: 0, typ: NTI33554440, name: "backgroundImage", sons: null}, -{kind: 1, offset: "backgroundOrigin", len: 0, typ: NTI33554440, name: "backgroundOrigin", sons: null}, -{kind: 1, offset: "backgroundPosition", len: 0, typ: NTI33554440, name: "backgroundPosition", sons: null}, -{kind: 1, offset: "backgroundRepeat", len: 0, typ: NTI33554440, name: "backgroundRepeat", sons: null}, -{kind: 1, offset: "backgroundSize", len: 0, typ: NTI33554440, name: "backgroundSize", sons: null}, -{kind: 1, offset: "blockSize", len: 0, typ: NTI33554440, name: "blockSize", sons: null}, -{kind: 1, offset: "border", len: 0, typ: NTI33554440, name: "border", sons: null}, -{kind: 1, offset: "borderBlock", len: 0, typ: NTI33554440, name: "borderBlock", sons: null}, -{kind: 1, offset: "borderBlockColor", len: 0, typ: NTI33554440, name: "borderBlockColor", sons: null}, -{kind: 1, offset: "borderBlockEnd", len: 0, typ: NTI33554440, name: "borderBlockEnd", sons: null}, -{kind: 1, offset: "borderBlockEndColor", len: 0, typ: NTI33554440, name: "borderBlockEndColor", sons: null}, -{kind: 1, offset: "borderBlockEndStyle", len: 0, typ: NTI33554440, name: "borderBlockEndStyle", sons: null}, -{kind: 1, offset: "borderBlockEndWidth", len: 0, typ: NTI33554440, name: "borderBlockEndWidth", sons: null}, -{kind: 1, offset: "borderBlockStart", len: 0, typ: NTI33554440, name: "borderBlockStart", sons: null}, -{kind: 1, offset: "borderBlockStartColor", len: 0, typ: NTI33554440, name: "borderBlockStartColor", sons: null}, -{kind: 1, offset: "borderBlockStartStyle", len: 0, typ: NTI33554440, name: "borderBlockStartStyle", sons: null}, -{kind: 1, offset: "borderBlockStartWidth", len: 0, typ: NTI33554440, name: "borderBlockStartWidth", sons: null}, -{kind: 1, offset: "borderBlockStyle", len: 0, typ: NTI33554440, name: "borderBlockStyle", sons: null}, -{kind: 1, offset: "borderBlockWidth", len: 0, typ: NTI33554440, name: "borderBlockWidth", sons: null}, -{kind: 1, offset: "borderBottom", len: 0, typ: NTI33554440, name: "borderBottom", sons: null}, -{kind: 1, offset: "borderBottomColor", len: 0, typ: NTI33554440, name: "borderBottomColor", sons: null}, -{kind: 1, offset: "borderBottomLeftRadius", len: 0, typ: NTI33554440, name: "borderBottomLeftRadius", sons: null}, -{kind: 1, offset: "borderBottomRightRadius", len: 0, typ: NTI33554440, name: "borderBottomRightRadius", sons: null}, -{kind: 1, offset: "borderBottomStyle", len: 0, typ: NTI33554440, name: "borderBottomStyle", sons: null}, -{kind: 1, offset: "borderBottomWidth", len: 0, typ: NTI33554440, name: "borderBottomWidth", sons: null}, -{kind: 1, offset: "borderCollapse", len: 0, typ: NTI33554440, name: "borderCollapse", sons: null}, -{kind: 1, offset: "borderColor", len: 0, typ: NTI33554440, name: "borderColor", sons: null}, -{kind: 1, offset: "borderEndEndRadius", len: 0, typ: NTI33554440, name: "borderEndEndRadius", sons: null}, -{kind: 1, offset: "borderEndStartRadius", len: 0, typ: NTI33554440, name: "borderEndStartRadius", sons: null}, -{kind: 1, offset: "borderImage", len: 0, typ: NTI33554440, name: "borderImage", sons: null}, -{kind: 1, offset: "borderImageOutset", len: 0, typ: NTI33554440, name: "borderImageOutset", sons: null}, -{kind: 1, offset: "borderImageRepeat", len: 0, typ: NTI33554440, name: "borderImageRepeat", sons: null}, -{kind: 1, offset: "borderImageSlice", len: 0, typ: NTI33554440, name: "borderImageSlice", sons: null}, -{kind: 1, offset: "borderImageSource", len: 0, typ: NTI33554440, name: "borderImageSource", sons: null}, -{kind: 1, offset: "borderImageWidth", len: 0, typ: NTI33554440, name: "borderImageWidth", sons: null}, -{kind: 1, offset: "borderInline", len: 0, typ: NTI33554440, name: "borderInline", sons: null}, -{kind: 1, offset: "borderInlineColor", len: 0, typ: NTI33554440, name: "borderInlineColor", sons: null}, -{kind: 1, offset: "borderInlineEnd", len: 0, typ: NTI33554440, name: "borderInlineEnd", sons: null}, -{kind: 1, offset: "borderInlineEndColor", len: 0, typ: NTI33554440, name: "borderInlineEndColor", sons: null}, -{kind: 1, offset: "borderInlineEndStyle", len: 0, typ: NTI33554440, name: "borderInlineEndStyle", sons: null}, -{kind: 1, offset: "borderInlineEndWidth", len: 0, typ: NTI33554440, name: "borderInlineEndWidth", sons: null}, -{kind: 1, offset: "borderInlineStart", len: 0, typ: NTI33554440, name: "borderInlineStart", sons: null}, -{kind: 1, offset: "borderInlineStartColor", len: 0, typ: NTI33554440, name: "borderInlineStartColor", sons: null}, -{kind: 1, offset: "borderInlineStartStyle", len: 0, typ: NTI33554440, name: "borderInlineStartStyle", sons: null}, -{kind: 1, offset: "borderInlineStartWidth", len: 0, typ: NTI33554440, name: "borderInlineStartWidth", sons: null}, -{kind: 1, offset: "borderInlineStyle", len: 0, typ: NTI33554440, name: "borderInlineStyle", sons: null}, -{kind: 1, offset: "borderInlineWidth", len: 0, typ: NTI33554440, name: "borderInlineWidth", sons: null}, -{kind: 1, offset: "borderLeft", len: 0, typ: NTI33554440, name: "borderLeft", sons: null}, -{kind: 1, offset: "borderLeftColor", len: 0, typ: NTI33554440, name: "borderLeftColor", sons: null}, -{kind: 1, offset: "borderLeftStyle", len: 0, typ: NTI33554440, name: "borderLeftStyle", sons: null}, -{kind: 1, offset: "borderLeftWidth", len: 0, typ: NTI33554440, name: "borderLeftWidth", sons: null}, -{kind: 1, offset: "borderRadius", len: 0, typ: NTI33554440, name: "borderRadius", sons: null}, -{kind: 1, offset: "borderRight", len: 0, typ: NTI33554440, name: "borderRight", sons: null}, -{kind: 1, offset: "borderRightColor", len: 0, typ: NTI33554440, name: "borderRightColor", sons: null}, -{kind: 1, offset: "borderRightStyle", len: 0, typ: NTI33554440, name: "borderRightStyle", sons: null}, -{kind: 1, offset: "borderRightWidth", len: 0, typ: NTI33554440, name: "borderRightWidth", sons: null}, -{kind: 1, offset: "borderSpacing", len: 0, typ: NTI33554440, name: "borderSpacing", sons: null}, -{kind: 1, offset: "borderStartEndRadius", len: 0, typ: NTI33554440, name: "borderStartEndRadius", sons: null}, -{kind: 1, offset: "borderStartStartRadius", len: 0, typ: NTI33554440, name: "borderStartStartRadius", sons: null}, -{kind: 1, offset: "borderStyle", len: 0, typ: NTI33554440, name: "borderStyle", sons: null}, -{kind: 1, offset: "borderTop", len: 0, typ: NTI33554440, name: "borderTop", sons: null}, -{kind: 1, offset: "borderTopColor", len: 0, typ: NTI33554440, name: "borderTopColor", sons: null}, -{kind: 1, offset: "borderTopLeftRadius", len: 0, typ: NTI33554440, name: "borderTopLeftRadius", sons: null}, -{kind: 1, offset: "borderTopRightRadius", len: 0, typ: NTI33554440, name: "borderTopRightRadius", sons: null}, -{kind: 1, offset: "borderTopStyle", len: 0, typ: NTI33554440, name: "borderTopStyle", sons: null}, -{kind: 1, offset: "borderTopWidth", len: 0, typ: NTI33554440, name: "borderTopWidth", sons: null}, -{kind: 1, offset: "borderWidth", len: 0, typ: NTI33554440, name: "borderWidth", sons: null}, -{kind: 1, offset: "bottom", len: 0, typ: NTI33554440, name: "bottom", sons: null}, -{kind: 1, offset: "boxDecorationBreak", len: 0, typ: NTI33554440, name: "boxDecorationBreak", sons: null}, -{kind: 1, offset: "boxShadow", len: 0, typ: NTI33554440, name: "boxShadow", sons: null}, -{kind: 1, offset: "boxSizing", len: 0, typ: NTI33554440, name: "boxSizing", sons: null}, -{kind: 1, offset: "breakAfter", len: 0, typ: NTI33554440, name: "breakAfter", sons: null}, -{kind: 1, offset: "breakBefore", len: 0, typ: NTI33554440, name: "breakBefore", sons: null}, -{kind: 1, offset: "breakInside", len: 0, typ: NTI33554440, name: "breakInside", sons: null}, -{kind: 1, offset: "captionSide", len: 0, typ: NTI33554440, name: "captionSide", sons: null}, -{kind: 1, offset: "caretColor", len: 0, typ: NTI33554440, name: "caretColor", sons: null}, -{kind: 1, offset: "clear", len: 0, typ: NTI33554440, name: "clear", sons: null}, -{kind: 1, offset: "clip", len: 0, typ: NTI33554440, name: "clip", sons: null}, -{kind: 1, offset: "clipPath", len: 0, typ: NTI33554440, name: "clipPath", sons: null}, -{kind: 1, offset: "color", len: 0, typ: NTI33554440, name: "color", sons: null}, -{kind: 1, offset: "colorAdjust", len: 0, typ: NTI33554440, name: "colorAdjust", sons: null}, -{kind: 1, offset: "columnCount", len: 0, typ: NTI33554440, name: "columnCount", sons: null}, -{kind: 1, offset: "columnFill", len: 0, typ: NTI33554440, name: "columnFill", sons: null}, -{kind: 1, offset: "columnGap", len: 0, typ: NTI33554440, name: "columnGap", sons: null}, -{kind: 1, offset: "columnRule", len: 0, typ: NTI33554440, name: "columnRule", sons: null}, -{kind: 1, offset: "columnRuleColor", len: 0, typ: NTI33554440, name: "columnRuleColor", sons: null}, -{kind: 1, offset: "columnRuleStyle", len: 0, typ: NTI33554440, name: "columnRuleStyle", sons: null}, -{kind: 1, offset: "columnRuleWidth", len: 0, typ: NTI33554440, name: "columnRuleWidth", sons: null}, -{kind: 1, offset: "columnSpan", len: 0, typ: NTI33554440, name: "columnSpan", sons: null}, -{kind: 1, offset: "columnWidth", len: 0, typ: NTI33554440, name: "columnWidth", sons: null}, -{kind: 1, offset: "columns", len: 0, typ: NTI33554440, name: "columns", sons: null}, -{kind: 1, offset: "contain", len: 0, typ: NTI33554440, name: "contain", sons: null}, -{kind: 1, offset: "content", len: 0, typ: NTI33554440, name: "content", sons: null}, -{kind: 1, offset: "counterIncrement", len: 0, typ: NTI33554440, name: "counterIncrement", sons: null}, -{kind: 1, offset: "counterReset", len: 0, typ: NTI33554440, name: "counterReset", sons: null}, -{kind: 1, offset: "counterSet", len: 0, typ: NTI33554440, name: "counterSet", sons: null}, -{kind: 1, offset: "cursor", len: 0, typ: NTI33554440, name: "cursor", sons: null}, -{kind: 1, offset: "direction", len: 0, typ: NTI33554440, name: "direction", sons: null}, -{kind: 1, offset: "display", len: 0, typ: NTI33554440, name: "display", sons: null}, -{kind: 1, offset: "emptyCells", len: 0, typ: NTI33554440, name: "emptyCells", sons: null}, -{kind: 1, offset: "filter", len: 0, typ: NTI33554440, name: "filter", sons: null}, -{kind: 1, offset: "flex", len: 0, typ: NTI33554440, name: "flex", sons: null}, -{kind: 1, offset: "flexBasis", len: 0, typ: NTI33554440, name: "flexBasis", sons: null}, -{kind: 1, offset: "flexDirection", len: 0, typ: NTI33554440, name: "flexDirection", sons: null}, -{kind: 1, offset: "flexFlow", len: 0, typ: NTI33554440, name: "flexFlow", sons: null}, -{kind: 1, offset: "flexGrow", len: 0, typ: NTI33554440, name: "flexGrow", sons: null}, -{kind: 1, offset: "flexShrink", len: 0, typ: NTI33554440, name: "flexShrink", sons: null}, -{kind: 1, offset: "flexWrap", len: 0, typ: NTI33554440, name: "flexWrap", sons: null}, -{kind: 1, offset: "cssFloat", len: 0, typ: NTI33554440, name: "cssFloat", sons: null}, -{kind: 1, offset: "font", len: 0, typ: NTI33554440, name: "font", sons: null}, -{kind: 1, offset: "fontFamily", len: 0, typ: NTI33554440, name: "fontFamily", sons: null}, -{kind: 1, offset: "fontFeatureSettings", len: 0, typ: NTI33554440, name: "fontFeatureSettings", sons: null}, -{kind: 1, offset: "fontKerning", len: 0, typ: NTI33554440, name: "fontKerning", sons: null}, -{kind: 1, offset: "fontLanguageOverride", len: 0, typ: NTI33554440, name: "fontLanguageOverride", sons: null}, -{kind: 1, offset: "fontOpticalSizing", len: 0, typ: NTI33554440, name: "fontOpticalSizing", sons: null}, -{kind: 1, offset: "fontSize", len: 0, typ: NTI33554440, name: "fontSize", sons: null}, -{kind: 1, offset: "fontSizeAdjust", len: 0, typ: NTI33554440, name: "fontSizeAdjust", sons: null}, -{kind: 1, offset: "fontStretch", len: 0, typ: NTI33554440, name: "fontStretch", sons: null}, -{kind: 1, offset: "fontStyle", len: 0, typ: NTI33554440, name: "fontStyle", sons: null}, -{kind: 1, offset: "fontSynthesis", len: 0, typ: NTI33554440, name: "fontSynthesis", sons: null}, -{kind: 1, offset: "fontVariant", len: 0, typ: NTI33554440, name: "fontVariant", sons: null}, -{kind: 1, offset: "fontVariantAlternates", len: 0, typ: NTI33554440, name: "fontVariantAlternates", sons: null}, -{kind: 1, offset: "fontVariantCaps", len: 0, typ: NTI33554440, name: "fontVariantCaps", sons: null}, -{kind: 1, offset: "fontVariantEastAsian", len: 0, typ: NTI33554440, name: "fontVariantEastAsian", sons: null}, -{kind: 1, offset: "fontVariantLigatures", len: 0, typ: NTI33554440, name: "fontVariantLigatures", sons: null}, -{kind: 1, offset: "fontVariantNumeric", len: 0, typ: NTI33554440, name: "fontVariantNumeric", sons: null}, -{kind: 1, offset: "fontVariantPosition", len: 0, typ: NTI33554440, name: "fontVariantPosition", sons: null}, -{kind: 1, offset: "fontVariationSettings", len: 0, typ: NTI33554440, name: "fontVariationSettings", sons: null}, -{kind: 1, offset: "fontWeight", len: 0, typ: NTI33554440, name: "fontWeight", sons: null}, -{kind: 1, offset: "gap", len: 0, typ: NTI33554440, name: "gap", sons: null}, -{kind: 1, offset: "grid", len: 0, typ: NTI33554440, name: "grid", sons: null}, -{kind: 1, offset: "gridArea", len: 0, typ: NTI33554440, name: "gridArea", sons: null}, -{kind: 1, offset: "gridAutoColumns", len: 0, typ: NTI33554440, name: "gridAutoColumns", sons: null}, -{kind: 1, offset: "gridAutoFlow", len: 0, typ: NTI33554440, name: "gridAutoFlow", sons: null}, -{kind: 1, offset: "gridAutoRows", len: 0, typ: NTI33554440, name: "gridAutoRows", sons: null}, -{kind: 1, offset: "gridColumn", len: 0, typ: NTI33554440, name: "gridColumn", sons: null}, -{kind: 1, offset: "gridColumnEnd", len: 0, typ: NTI33554440, name: "gridColumnEnd", sons: null}, -{kind: 1, offset: "gridColumnStart", len: 0, typ: NTI33554440, name: "gridColumnStart", sons: null}, -{kind: 1, offset: "gridRow", len: 0, typ: NTI33554440, name: "gridRow", sons: null}, -{kind: 1, offset: "gridRowEnd", len: 0, typ: NTI33554440, name: "gridRowEnd", sons: null}, -{kind: 1, offset: "gridRowStart", len: 0, typ: NTI33554440, name: "gridRowStart", sons: null}, -{kind: 1, offset: "gridTemplate", len: 0, typ: NTI33554440, name: "gridTemplate", sons: null}, -{kind: 1, offset: "gridTemplateAreas", len: 0, typ: NTI33554440, name: "gridTemplateAreas", sons: null}, -{kind: 1, offset: "gridTemplateColumns", len: 0, typ: NTI33554440, name: "gridTemplateColumns", sons: null}, -{kind: 1, offset: "gridTemplateRows", len: 0, typ: NTI33554440, name: "gridTemplateRows", sons: null}, -{kind: 1, offset: "hangingPunctuation", len: 0, typ: NTI33554440, name: "hangingPunctuation", sons: null}, -{kind: 1, offset: "height", len: 0, typ: NTI33554440, name: "height", sons: null}, -{kind: 1, offset: "hyphens", len: 0, typ: NTI33554440, name: "hyphens", sons: null}, -{kind: 1, offset: "imageOrientation", len: 0, typ: NTI33554440, name: "imageOrientation", sons: null}, -{kind: 1, offset: "imageRendering", len: 0, typ: NTI33554440, name: "imageRendering", sons: null}, -{kind: 1, offset: "inlineSize", len: 0, typ: NTI33554440, name: "inlineSize", sons: null}, -{kind: 1, offset: "inset", len: 0, typ: NTI33554440, name: "inset", sons: null}, -{kind: 1, offset: "insetBlock", len: 0, typ: NTI33554440, name: "insetBlock", sons: null}, -{kind: 1, offset: "insetBlockEnd", len: 0, typ: NTI33554440, name: "insetBlockEnd", sons: null}, -{kind: 1, offset: "insetBlockStart", len: 0, typ: NTI33554440, name: "insetBlockStart", sons: null}, -{kind: 1, offset: "insetInline", len: 0, typ: NTI33554440, name: "insetInline", sons: null}, -{kind: 1, offset: "insetInlineEnd", len: 0, typ: NTI33554440, name: "insetInlineEnd", sons: null}, -{kind: 1, offset: "insetInlineStart", len: 0, typ: NTI33554440, name: "insetInlineStart", sons: null}, -{kind: 1, offset: "isolation", len: 0, typ: NTI33554440, name: "isolation", sons: null}, -{kind: 1, offset: "justifyContent", len: 0, typ: NTI33554440, name: "justifyContent", sons: null}, -{kind: 1, offset: "justifyItems", len: 0, typ: NTI33554440, name: "justifyItems", sons: null}, -{kind: 1, offset: "justifySelf", len: 0, typ: NTI33554440, name: "justifySelf", sons: null}, -{kind: 1, offset: "left", len: 0, typ: NTI33554440, name: "left", sons: null}, -{kind: 1, offset: "letterSpacing", len: 0, typ: NTI33554440, name: "letterSpacing", sons: null}, -{kind: 1, offset: "lineBreak", len: 0, typ: NTI33554440, name: "lineBreak", sons: null}, -{kind: 1, offset: "lineHeight", len: 0, typ: NTI33554440, name: "lineHeight", sons: null}, -{kind: 1, offset: "listStyle", len: 0, typ: NTI33554440, name: "listStyle", sons: null}, -{kind: 1, offset: "listStyleImage", len: 0, typ: NTI33554440, name: "listStyleImage", sons: null}, -{kind: 1, offset: "listStylePosition", len: 0, typ: NTI33554440, name: "listStylePosition", sons: null}, -{kind: 1, offset: "listStyleType", len: 0, typ: NTI33554440, name: "listStyleType", sons: null}, -{kind: 1, offset: "margin", len: 0, typ: NTI33554440, name: "margin", sons: null}, -{kind: 1, offset: "marginBlock", len: 0, typ: NTI33554440, name: "marginBlock", sons: null}, -{kind: 1, offset: "marginBlockEnd", len: 0, typ: NTI33554440, name: "marginBlockEnd", sons: null}, -{kind: 1, offset: "marginBlockStart", len: 0, typ: NTI33554440, name: "marginBlockStart", sons: null}, -{kind: 1, offset: "marginBottom", len: 0, typ: NTI33554440, name: "marginBottom", sons: null}, -{kind: 1, offset: "marginInline", len: 0, typ: NTI33554440, name: "marginInline", sons: null}, -{kind: 1, offset: "marginInlineEnd", len: 0, typ: NTI33554440, name: "marginInlineEnd", sons: null}, -{kind: 1, offset: "marginInlineStart", len: 0, typ: NTI33554440, name: "marginInlineStart", sons: null}, -{kind: 1, offset: "marginLeft", len: 0, typ: NTI33554440, name: "marginLeft", sons: null}, -{kind: 1, offset: "marginRight", len: 0, typ: NTI33554440, name: "marginRight", sons: null}, -{kind: 1, offset: "marginTop", len: 0, typ: NTI33554440, name: "marginTop", sons: null}, -{kind: 1, offset: "mask", len: 0, typ: NTI33554440, name: "mask", sons: null}, -{kind: 1, offset: "maskBorder", len: 0, typ: NTI33554440, name: "maskBorder", sons: null}, -{kind: 1, offset: "maskBorderMode", len: 0, typ: NTI33554440, name: "maskBorderMode", sons: null}, -{kind: 1, offset: "maskBorderOutset", len: 0, typ: NTI33554440, name: "maskBorderOutset", sons: null}, -{kind: 1, offset: "maskBorderRepeat", len: 0, typ: NTI33554440, name: "maskBorderRepeat", sons: null}, -{kind: 1, offset: "maskBorderSlice", len: 0, typ: NTI33554440, name: "maskBorderSlice", sons: null}, -{kind: 1, offset: "maskBorderSource", len: 0, typ: NTI33554440, name: "maskBorderSource", sons: null}, -{kind: 1, offset: "maskBorderWidth", len: 0, typ: NTI33554440, name: "maskBorderWidth", sons: null}, -{kind: 1, offset: "maskClip", len: 0, typ: NTI33554440, name: "maskClip", sons: null}, -{kind: 1, offset: "maskComposite", len: 0, typ: NTI33554440, name: "maskComposite", sons: null}, -{kind: 1, offset: "maskImage", len: 0, typ: NTI33554440, name: "maskImage", sons: null}, -{kind: 1, offset: "maskMode", len: 0, typ: NTI33554440, name: "maskMode", sons: null}, -{kind: 1, offset: "maskOrigin", len: 0, typ: NTI33554440, name: "maskOrigin", sons: null}, -{kind: 1, offset: "maskPosition", len: 0, typ: NTI33554440, name: "maskPosition", sons: null}, -{kind: 1, offset: "maskRepeat", len: 0, typ: NTI33554440, name: "maskRepeat", sons: null}, -{kind: 1, offset: "maskSize", len: 0, typ: NTI33554440, name: "maskSize", sons: null}, -{kind: 1, offset: "maskType", len: 0, typ: NTI33554440, name: "maskType", sons: null}, -{kind: 1, offset: "maxBlockSize", len: 0, typ: NTI33554440, name: "maxBlockSize", sons: null}, -{kind: 1, offset: "maxHeight", len: 0, typ: NTI33554440, name: "maxHeight", sons: null}, -{kind: 1, offset: "maxInlineSize", len: 0, typ: NTI33554440, name: "maxInlineSize", sons: null}, -{kind: 1, offset: "maxWidth", len: 0, typ: NTI33554440, name: "maxWidth", sons: null}, -{kind: 1, offset: "minBlockSize", len: 0, typ: NTI33554440, name: "minBlockSize", sons: null}, -{kind: 1, offset: "minHeight", len: 0, typ: NTI33554440, name: "minHeight", sons: null}, -{kind: 1, offset: "minInlineSize", len: 0, typ: NTI33554440, name: "minInlineSize", sons: null}, -{kind: 1, offset: "minWidth", len: 0, typ: NTI33554440, name: "minWidth", sons: null}, -{kind: 1, offset: "mixBlendMode", len: 0, typ: NTI33554440, name: "mixBlendMode", sons: null}, -{kind: 1, offset: "objectFit", len: 0, typ: NTI33554440, name: "objectFit", sons: null}, -{kind: 1, offset: "objectPosition", len: 0, typ: NTI33554440, name: "objectPosition", sons: null}, -{kind: 1, offset: "offset", len: 0, typ: NTI33554440, name: "offset", sons: null}, -{kind: 1, offset: "offsetAnchor", len: 0, typ: NTI33554440, name: "offsetAnchor", sons: null}, -{kind: 1, offset: "offsetDistance", len: 0, typ: NTI33554440, name: "offsetDistance", sons: null}, -{kind: 1, offset: "offsetPath", len: 0, typ: NTI33554440, name: "offsetPath", sons: null}, -{kind: 1, offset: "offsetRotate", len: 0, typ: NTI33554440, name: "offsetRotate", sons: null}, -{kind: 1, offset: "opacity", len: 0, typ: NTI33554440, name: "opacity", sons: null}, -{kind: 1, offset: "order", len: 0, typ: NTI33554440, name: "order", sons: null}, -{kind: 1, offset: "orphans", len: 0, typ: NTI33554440, name: "orphans", sons: null}, -{kind: 1, offset: "outline", len: 0, typ: NTI33554440, name: "outline", sons: null}, -{kind: 1, offset: "outlineColor", len: 0, typ: NTI33554440, name: "outlineColor", sons: null}, -{kind: 1, offset: "outlineOffset", len: 0, typ: NTI33554440, name: "outlineOffset", sons: null}, -{kind: 1, offset: "outlineStyle", len: 0, typ: NTI33554440, name: "outlineStyle", sons: null}, -{kind: 1, offset: "outlineWidth", len: 0, typ: NTI33554440, name: "outlineWidth", sons: null}, -{kind: 1, offset: "overflow", len: 0, typ: NTI33554440, name: "overflow", sons: null}, -{kind: 1, offset: "overflowAnchor", len: 0, typ: NTI33554440, name: "overflowAnchor", sons: null}, -{kind: 1, offset: "overflowBlock", len: 0, typ: NTI33554440, name: "overflowBlock", sons: null}, -{kind: 1, offset: "overflowInline", len: 0, typ: NTI33554440, name: "overflowInline", sons: null}, -{kind: 1, offset: "overflowWrap", len: 0, typ: NTI33554440, name: "overflowWrap", sons: null}, -{kind: 1, offset: "overflowX", len: 0, typ: NTI33554440, name: "overflowX", sons: null}, -{kind: 1, offset: "overflowY", len: 0, typ: NTI33554440, name: "overflowY", sons: null}, -{kind: 1, offset: "overscrollBehavior", len: 0, typ: NTI33554440, name: "overscrollBehavior", sons: null}, -{kind: 1, offset: "overscrollBehaviorBlock", len: 0, typ: NTI33554440, name: "overscrollBehaviorBlock", sons: null}, -{kind: 1, offset: "overscrollBehaviorInline", len: 0, typ: NTI33554440, name: "overscrollBehaviorInline", sons: null}, -{kind: 1, offset: "overscrollBehaviorX", len: 0, typ: NTI33554440, name: "overscrollBehaviorX", sons: null}, -{kind: 1, offset: "overscrollBehaviorY", len: 0, typ: NTI33554440, name: "overscrollBehaviorY", sons: null}, -{kind: 1, offset: "padding", len: 0, typ: NTI33554440, name: "padding", sons: null}, -{kind: 1, offset: "paddingBlock", len: 0, typ: NTI33554440, name: "paddingBlock", sons: null}, -{kind: 1, offset: "paddingBlockEnd", len: 0, typ: NTI33554440, name: "paddingBlockEnd", sons: null}, -{kind: 1, offset: "paddingBlockStart", len: 0, typ: NTI33554440, name: "paddingBlockStart", sons: null}, -{kind: 1, offset: "paddingBottom", len: 0, typ: NTI33554440, name: "paddingBottom", sons: null}, -{kind: 1, offset: "paddingInline", len: 0, typ: NTI33554440, name: "paddingInline", sons: null}, -{kind: 1, offset: "paddingInlineEnd", len: 0, typ: NTI33554440, name: "paddingInlineEnd", sons: null}, -{kind: 1, offset: "paddingInlineStart", len: 0, typ: NTI33554440, name: "paddingInlineStart", sons: null}, -{kind: 1, offset: "paddingLeft", len: 0, typ: NTI33554440, name: "paddingLeft", sons: null}, -{kind: 1, offset: "paddingRight", len: 0, typ: NTI33554440, name: "paddingRight", sons: null}, -{kind: 1, offset: "paddingTop", len: 0, typ: NTI33554440, name: "paddingTop", sons: null}, -{kind: 1, offset: "pageBreakAfter", len: 0, typ: NTI33554440, name: "pageBreakAfter", sons: null}, -{kind: 1, offset: "pageBreakBefore", len: 0, typ: NTI33554440, name: "pageBreakBefore", sons: null}, -{kind: 1, offset: "pageBreakInside", len: 0, typ: NTI33554440, name: "pageBreakInside", sons: null}, -{kind: 1, offset: "paintOrder", len: 0, typ: NTI33554440, name: "paintOrder", sons: null}, -{kind: 1, offset: "perspective", len: 0, typ: NTI33554440, name: "perspective", sons: null}, -{kind: 1, offset: "perspectiveOrigin", len: 0, typ: NTI33554440, name: "perspectiveOrigin", sons: null}, -{kind: 1, offset: "placeContent", len: 0, typ: NTI33554440, name: "placeContent", sons: null}, -{kind: 1, offset: "placeItems", len: 0, typ: NTI33554440, name: "placeItems", sons: null}, -{kind: 1, offset: "placeSelf", len: 0, typ: NTI33554440, name: "placeSelf", sons: null}, -{kind: 1, offset: "pointerEvents", len: 0, typ: NTI33554440, name: "pointerEvents", sons: null}, -{kind: 1, offset: "position", len: 0, typ: NTI33554440, name: "position", sons: null}, -{kind: 1, offset: "quotes", len: 0, typ: NTI33554440, name: "quotes", sons: null}, -{kind: 1, offset: "resize", len: 0, typ: NTI33554440, name: "resize", sons: null}, -{kind: 1, offset: "right", len: 0, typ: NTI33554440, name: "right", sons: null}, -{kind: 1, offset: "rotate", len: 0, typ: NTI33554440, name: "rotate", sons: null}, -{kind: 1, offset: "rowGap", len: 0, typ: NTI33554440, name: "rowGap", sons: null}, -{kind: 1, offset: "scale", len: 0, typ: NTI33554440, name: "scale", sons: null}, -{kind: 1, offset: "scrollBehavior", len: 0, typ: NTI33554440, name: "scrollBehavior", sons: null}, -{kind: 1, offset: "scrollMargin", len: 0, typ: NTI33554440, name: "scrollMargin", sons: null}, -{kind: 1, offset: "scrollMarginBlock", len: 0, typ: NTI33554440, name: "scrollMarginBlock", sons: null}, -{kind: 1, offset: "scrollMarginBlockEnd", len: 0, typ: NTI33554440, name: "scrollMarginBlockEnd", sons: null}, -{kind: 1, offset: "scrollMarginBlockStart", len: 0, typ: NTI33554440, name: "scrollMarginBlockStart", sons: null}, -{kind: 1, offset: "scrollMarginBottom", len: 0, typ: NTI33554440, name: "scrollMarginBottom", sons: null}, -{kind: 1, offset: "scrollMarginInline", len: 0, typ: NTI33554440, name: "scrollMarginInline", sons: null}, -{kind: 1, offset: "scrollMarginInlineEnd", len: 0, typ: NTI33554440, name: "scrollMarginInlineEnd", sons: null}, -{kind: 1, offset: "scrollMarginInlineStart", len: 0, typ: NTI33554440, name: "scrollMarginInlineStart", sons: null}, -{kind: 1, offset: "scrollMarginLeft", len: 0, typ: NTI33554440, name: "scrollMarginLeft", sons: null}, -{kind: 1, offset: "scrollMarginRight", len: 0, typ: NTI33554440, name: "scrollMarginRight", sons: null}, -{kind: 1, offset: "scrollMarginTop", len: 0, typ: NTI33554440, name: "scrollMarginTop", sons: null}, -{kind: 1, offset: "scrollPadding", len: 0, typ: NTI33554440, name: "scrollPadding", sons: null}, -{kind: 1, offset: "scrollPaddingBlock", len: 0, typ: NTI33554440, name: "scrollPaddingBlock", sons: null}, -{kind: 1, offset: "scrollPaddingBlockEnd", len: 0, typ: NTI33554440, name: "scrollPaddingBlockEnd", sons: null}, -{kind: 1, offset: "scrollPaddingBlockStart", len: 0, typ: NTI33554440, name: "scrollPaddingBlockStart", sons: null}, -{kind: 1, offset: "scrollPaddingBottom", len: 0, typ: NTI33554440, name: "scrollPaddingBottom", sons: null}, -{kind: 1, offset: "scrollPaddingInline", len: 0, typ: NTI33554440, name: "scrollPaddingInline", sons: null}, -{kind: 1, offset: "scrollPaddingInlineEnd", len: 0, typ: NTI33554440, name: "scrollPaddingInlineEnd", sons: null}, -{kind: 1, offset: "scrollPaddingInlineStart", len: 0, typ: NTI33554440, name: "scrollPaddingInlineStart", sons: null}, -{kind: 1, offset: "scrollPaddingLeft", len: 0, typ: NTI33554440, name: "scrollPaddingLeft", sons: null}, -{kind: 1, offset: "scrollPaddingRight", len: 0, typ: NTI33554440, name: "scrollPaddingRight", sons: null}, -{kind: 1, offset: "scrollPaddingTop", len: 0, typ: NTI33554440, name: "scrollPaddingTop", sons: null}, -{kind: 1, offset: "scrollSnapAlign", len: 0, typ: NTI33554440, name: "scrollSnapAlign", sons: null}, -{kind: 1, offset: "scrollSnapStop", len: 0, typ: NTI33554440, name: "scrollSnapStop", sons: null}, -{kind: 1, offset: "scrollSnapType", len: 0, typ: NTI33554440, name: "scrollSnapType", sons: null}, -{kind: 1, offset: "scrollbar3dLightColor", len: 0, typ: NTI33554440, name: "scrollbar3dLightColor", sons: null}, -{kind: 1, offset: "scrollbarArrowColor", len: 0, typ: NTI33554440, name: "scrollbarArrowColor", sons: null}, -{kind: 1, offset: "scrollbarBaseColor", len: 0, typ: NTI33554440, name: "scrollbarBaseColor", sons: null}, -{kind: 1, offset: "scrollbarColor", len: 0, typ: NTI33554440, name: "scrollbarColor", sons: null}, -{kind: 1, offset: "scrollbarDarkshadowColor", len: 0, typ: NTI33554440, name: "scrollbarDarkshadowColor", sons: null}, -{kind: 1, offset: "scrollbarFaceColor", len: 0, typ: NTI33554440, name: "scrollbarFaceColor", sons: null}, -{kind: 1, offset: "scrollbarHighlightColor", len: 0, typ: NTI33554440, name: "scrollbarHighlightColor", sons: null}, -{kind: 1, offset: "scrollbarShadowColor", len: 0, typ: NTI33554440, name: "scrollbarShadowColor", sons: null}, -{kind: 1, offset: "scrollbarTrackColor", len: 0, typ: NTI33554440, name: "scrollbarTrackColor", sons: null}, -{kind: 1, offset: "scrollbarWidth", len: 0, typ: NTI33554440, name: "scrollbarWidth", sons: null}, -{kind: 1, offset: "shapeImageThreshold", len: 0, typ: NTI33554440, name: "shapeImageThreshold", sons: null}, -{kind: 1, offset: "shapeMargin", len: 0, typ: NTI33554440, name: "shapeMargin", sons: null}, -{kind: 1, offset: "shapeOutside", len: 0, typ: NTI33554440, name: "shapeOutside", sons: null}, -{kind: 1, offset: "tabSize", len: 0, typ: NTI33554440, name: "tabSize", sons: null}, -{kind: 1, offset: "tableLayout", len: 0, typ: NTI33554440, name: "tableLayout", sons: null}, -{kind: 1, offset: "textAlign", len: 0, typ: NTI33554440, name: "textAlign", sons: null}, -{kind: 1, offset: "textAlignLast", len: 0, typ: NTI33554440, name: "textAlignLast", sons: null}, -{kind: 1, offset: "textCombineUpright", len: 0, typ: NTI33554440, name: "textCombineUpright", sons: null}, -{kind: 1, offset: "textDecoration", len: 0, typ: NTI33554440, name: "textDecoration", sons: null}, -{kind: 1, offset: "textDecorationColor", len: 0, typ: NTI33554440, name: "textDecorationColor", sons: null}, -{kind: 1, offset: "textDecorationLine", len: 0, typ: NTI33554440, name: "textDecorationLine", sons: null}, -{kind: 1, offset: "textDecorationSkipInk", len: 0, typ: NTI33554440, name: "textDecorationSkipInk", sons: null}, -{kind: 1, offset: "textDecorationStyle", len: 0, typ: NTI33554440, name: "textDecorationStyle", sons: null}, -{kind: 1, offset: "textDecorationThickness", len: 0, typ: NTI33554440, name: "textDecorationThickness", sons: null}, -{kind: 1, offset: "textEmphasis", len: 0, typ: NTI33554440, name: "textEmphasis", sons: null}, -{kind: 1, offset: "textEmphasisColor", len: 0, typ: NTI33554440, name: "textEmphasisColor", sons: null}, -{kind: 1, offset: "textEmphasisPosition", len: 0, typ: NTI33554440, name: "textEmphasisPosition", sons: null}, -{kind: 1, offset: "textEmphasisStyle", len: 0, typ: NTI33554440, name: "textEmphasisStyle", sons: null}, -{kind: 1, offset: "textIndent", len: 0, typ: NTI33554440, name: "textIndent", sons: null}, -{kind: 1, offset: "textJustify", len: 0, typ: NTI33554440, name: "textJustify", sons: null}, -{kind: 1, offset: "textOrientation", len: 0, typ: NTI33554440, name: "textOrientation", sons: null}, -{kind: 1, offset: "textOverflow", len: 0, typ: NTI33554440, name: "textOverflow", sons: null}, -{kind: 1, offset: "textRendering", len: 0, typ: NTI33554440, name: "textRendering", sons: null}, -{kind: 1, offset: "textShadow", len: 0, typ: NTI33554440, name: "textShadow", sons: null}, -{kind: 1, offset: "textTransform", len: 0, typ: NTI33554440, name: "textTransform", sons: null}, -{kind: 1, offset: "textUnderlineOffset", len: 0, typ: NTI33554440, name: "textUnderlineOffset", sons: null}, -{kind: 1, offset: "textUnderlinePosition", len: 0, typ: NTI33554440, name: "textUnderlinePosition", sons: null}, -{kind: 1, offset: "top", len: 0, typ: NTI33554440, name: "top", sons: null}, -{kind: 1, offset: "touchAction", len: 0, typ: NTI33554440, name: "touchAction", sons: null}, -{kind: 1, offset: "transform", len: 0, typ: NTI33554440, name: "transform", sons: null}, -{kind: 1, offset: "transformBox", len: 0, typ: NTI33554440, name: "transformBox", sons: null}, -{kind: 1, offset: "transformOrigin", len: 0, typ: NTI33554440, name: "transformOrigin", sons: null}, -{kind: 1, offset: "transformStyle", len: 0, typ: NTI33554440, name: "transformStyle", sons: null}, -{kind: 1, offset: "transition", len: 0, typ: NTI33554440, name: "transition", sons: null}, -{kind: 1, offset: "transitionDelay", len: 0, typ: NTI33554440, name: "transitionDelay", sons: null}, -{kind: 1, offset: "transitionDuration", len: 0, typ: NTI33554440, name: "transitionDuration", sons: null}, -{kind: 1, offset: "transitionProperty", len: 0, typ: NTI33554440, name: "transitionProperty", sons: null}, -{kind: 1, offset: "transitionTimingFunction", len: 0, typ: NTI33554440, name: "transitionTimingFunction", sons: null}, -{kind: 1, offset: "translate", len: 0, typ: NTI33554440, name: "translate", sons: null}, -{kind: 1, offset: "unicodeBidi", len: 0, typ: NTI33554440, name: "unicodeBidi", sons: null}, -{kind: 1, offset: "verticalAlign", len: 0, typ: NTI33554440, name: "verticalAlign", sons: null}, -{kind: 1, offset: "visibility", len: 0, typ: NTI33554440, name: "visibility", sons: null}, -{kind: 1, offset: "whiteSpace", len: 0, typ: NTI33554440, name: "whiteSpace", sons: null}, -{kind: 1, offset: "widows", len: 0, typ: NTI33554440, name: "widows", sons: null}, -{kind: 1, offset: "width", len: 0, typ: NTI33554440, name: "width", sons: null}, -{kind: 1, offset: "willChange", len: 0, typ: NTI33554440, name: "willChange", sons: null}, -{kind: 1, offset: "wordBreak", len: 0, typ: NTI33554440, name: "wordBreak", sons: null}, -{kind: 1, offset: "wordSpacing", len: 0, typ: NTI33554440, name: "wordSpacing", sons: null}, -{kind: 1, offset: "writingMode", len: 0, typ: NTI33554440, name: "writingMode", sons: null}, -{kind: 1, offset: "zIndex", len: 0, typ: NTI33554440, name: "zIndex", sons: null}]}; -NTI603979825.node = NNI603979825; -NTI603979825.base = NTI33555083; -NTI603979824.base = NTI603979825; -var NNI603979797 = {kind: 2, len: 22, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "attributes", len: 0, typ: NTI603979917, name: "attributes", sons: null}, -{kind: 1, offset: "childNodes", len: 0, typ: NTI603979918, name: "childNodes", sons: null}, -{kind: 1, offset: "children", len: 0, typ: NTI603979919, name: "children", sons: null}, -{kind: 1, offset: "data", len: 0, typ: NTI33554440, name: "data", sons: null}, -{kind: 1, offset: "firstChild", len: 0, typ: NTI603979796, name: "firstChild", sons: null}, -{kind: 1, offset: "lastChild", len: 0, typ: NTI603979796, name: "lastChild", sons: null}, -{kind: 1, offset: "nextSibling", len: 0, typ: NTI603979796, name: "nextSibling", sons: null}, -{kind: 1, offset: "nodeName", len: 0, typ: NTI33554440, name: "nodeName", sons: null}, -{kind: 1, offset: "nodeType", len: 0, typ: NTI603979795, name: "nodeType", sons: null}, -{kind: 1, offset: "nodeValue", len: 0, typ: NTI33554440, name: "nodeValue", sons: null}, -{kind: 1, offset: "parentNode", len: 0, typ: NTI603979796, name: "parentNode", sons: null}, -{kind: 1, offset: "content", len: 0, typ: NTI603979796, name: "content", sons: null}, -{kind: 1, offset: "previousSibling", len: 0, typ: NTI603979796, name: "previousSibling", sons: null}, -{kind: 1, offset: "ownerDocument", len: 0, typ: NTI603979798, name: "ownerDocument", sons: null}, -{kind: 1, offset: "innerHTML", len: 0, typ: NTI33554440, name: "innerHTML", sons: null}, -{kind: 1, offset: "outerHTML", len: 0, typ: NTI33554440, name: "outerHTML", sons: null}, -{kind: 1, offset: "innerText", len: 0, typ: NTI33554440, name: "innerText", sons: null}, -{kind: 1, offset: "textContent", len: 0, typ: NTI33554440, name: "textContent", sons: null}, -{kind: 1, offset: "style", len: 0, typ: NTI603979824, name: "style", sons: null}, -{kind: 1, offset: "baseURI", len: 0, typ: NTI33554440, name: "baseURI", sons: null}, -{kind: 1, offset: "parentElement", len: 0, typ: NTI603979800, name: "parentElement", sons: null}, -{kind: 1, offset: "isConnected", len: 0, typ: NTI33554466, name: "isConnected", sons: null}]}; -NTI603979797.node = NNI603979797; -var NNI603979781 = {kind: 2, len: 24, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "onabort", len: 0, typ: NTI603979876, name: "onabort", sons: null}, -{kind: 1, offset: "onblur", len: 0, typ: NTI603979877, name: "onblur", sons: null}, -{kind: 1, offset: "onchange", len: 0, typ: NTI603979878, name: "onchange", sons: null}, -{kind: 1, offset: "onclick", len: 0, typ: NTI603979879, name: "onclick", sons: null}, -{kind: 1, offset: "ondblclick", len: 0, typ: NTI603979880, name: "ondblclick", sons: null}, -{kind: 1, offset: "onerror", len: 0, typ: NTI603979881, name: "onerror", sons: null}, -{kind: 1, offset: "onfocus", len: 0, typ: NTI603979882, name: "onfocus", sons: null}, -{kind: 1, offset: "onkeydown", len: 0, typ: NTI603979883, name: "onkeydown", sons: null}, -{kind: 1, offset: "onkeypress", len: 0, typ: NTI603979884, name: "onkeypress", sons: null}, -{kind: 1, offset: "onkeyup", len: 0, typ: NTI603979885, name: "onkeyup", sons: null}, -{kind: 1, offset: "onload", len: 0, typ: NTI603979886, name: "onload", sons: null}, -{kind: 1, offset: "onmousedown", len: 0, typ: NTI603979887, name: "onmousedown", sons: null}, -{kind: 1, offset: "onmousemove", len: 0, typ: NTI603979888, name: "onmousemove", sons: null}, -{kind: 1, offset: "onmouseout", len: 0, typ: NTI603979889, name: "onmouseout", sons: null}, -{kind: 1, offset: "onmouseover", len: 0, typ: NTI603979890, name: "onmouseover", sons: null}, -{kind: 1, offset: "onmouseup", len: 0, typ: NTI603979891, name: "onmouseup", sons: null}, -{kind: 1, offset: "onreset", len: 0, typ: NTI603979892, name: "onreset", sons: null}, -{kind: 1, offset: "onselect", len: 0, typ: NTI603979893, name: "onselect", sons: null}, -{kind: 1, offset: "onstorage", len: 0, typ: NTI603979894, name: "onstorage", sons: null}, -{kind: 1, offset: "onsubmit", len: 0, typ: NTI603979895, name: "onsubmit", sons: null}, -{kind: 1, offset: "onunload", len: 0, typ: NTI603979896, name: "onunload", sons: null}, -{kind: 1, offset: "onloadstart", len: 0, typ: NTI603979897, name: "onloadstart", sons: null}, -{kind: 1, offset: "onprogress", len: 0, typ: NTI603979898, name: "onprogress", sons: null}, -{kind: 1, offset: "onloadend", len: 0, typ: NTI603979899, name: "onloadend", sons: null}]}; -NTI603979781.node = NNI603979781; -NTI603979781.base = NTI33555083; -NTI603979797.base = NTI603979781; -NTI603979796.base = NTI603979797; -NTI603980220.base = NTI603979796; -NTI469762606.base = NTI33554440; -var NNI620757006 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI33554456, name: "Field0", sons: null}, -{kind: 1, offset: "Field1", len: 0, typ: NTI33554466, name: "Field1", sons: null}]}; -NTI620757006.node = NNI620757006; - -function makeNimstrLit(c_33556801) { - var result = []; - for (var i = 0; i < c_33556801.length; ++i) { - result[i] = c_33556801.charCodeAt(i); - } - return result; - - - -} - -function toJSStr(s_33556807) { - var Temporary5; - var Temporary7; - - var result_33556808 = null; - - var res_33556842 = newSeq_33556825((s_33556807).length); - var i_33556843 = 0; - var j_33556844 = 0; - Label1: do { - Label2: while (true) { - if (!(i_33556843 < (s_33556807).length)) break Label2; - var c_33556845 = s_33556807[i_33556843]; - if ((c_33556845 < 128)) { - res_33556842[j_33556844] = String.fromCharCode(c_33556845); - i_33556843 += 1; - } - else { - var helper_33556857 = newSeq_33556825(0); - Label3: do { - Label4: while (true) { - if (!true) break Label4; - var code_33556858 = c_33556845.toString(16); - if ((((code_33556858) == null ? 0 : (code_33556858).length) == 1)) { - helper_33556857.push("%0");; - } - else { - helper_33556857.push("%");; - } - - helper_33556857.push(code_33556858);; - i_33556843 += 1; - if (((s_33556807).length <= i_33556843)) Temporary5 = true; else { Temporary5 = (s_33556807[i_33556843] < 128); } if (Temporary5) { - break Label3; - } - - c_33556845 = s_33556807[i_33556843]; - } - } while (false); -++excHandler; - Temporary7 = framePtr; - try { - res_33556842[j_33556844] = decodeURIComponent(helper_33556857.join("")); ---excHandler; -} catch (EXCEPTION) { - var prevJSError = lastJSError; - lastJSError = EXCEPTION; - --excHandler; - framePtr = Temporary7; - res_33556842[j_33556844] = helper_33556857.join(""); - lastJSError = prevJSError; - } finally { - framePtr = Temporary7; - } - } - - j_33556844 += 1; - } - } while (false); - if (res_33556842.length < j_33556844) { for (var i = res_33556842.length ; i < j_33556844 ; ++i) res_33556842.push(null); } - else { res_33556842.length = j_33556844; }; - result_33556808 = res_33556842.join(""); - - return result_33556808; - -} - -function raiseException(e_33556667, ename_33556668) { - e_33556667.name = ename_33556668; - if ((excHandler == 0)) { - unhandledException(e_33556667); - } - - throw e_33556667; - - -} - -function addInt(a_33556940, b_33556941) { - var result = a_33556940 + b_33556941; - checkOverflowInt(result); - return result; - - - -} - -function mnewString(len_33556893) { - return new Array(len_33556893); - - - -} - -function chckRange(i_33557189, a_33557190, b_33557191) { - var Temporary1; - - var result_33557192 = 0; - - BeforeRet: do { - if (!(a_33557190 <= i_33557189)) Temporary1 = false; else { Temporary1 = (i_33557189 <= b_33557191); } if (Temporary1) { - result_33557192 = i_33557189; - break BeforeRet; - } - else { - raiseRangeError(); - } - - } while (false); - - return result_33557192; - -} - -function setConstr() { - var result = {}; - for (var i = 0; i < arguments.length; ++i) { - var x = arguments[i]; - if (typeof(x) == "object") { - for (var j = x[0]; j <= x[1]; ++j) { - result[j] = true; - } - } else { - result[x] = true; - } - } - return result; - - - -} -var ConstSet1 = setConstr(17, 16, 4, 18, 27, 19, 23, 22, 21); - -function nimCopy(dest_33557140, src_33557141, ti_33557142) { - var result_33557151 = null; - - switch (ti_33557142.kind) { - case 21: - case 22: - case 23: - case 5: - if (!(isFatPointer_33557131(ti_33557142))) { - result_33557151 = src_33557141; - } - else { - result_33557151 = [src_33557141[0], src_33557141[1]]; - } - - break; - case 19: - if (dest_33557140 === null || dest_33557140 === undefined) { - dest_33557140 = {}; - } - else { - for (var key in dest_33557140) { delete dest_33557140[key]; } - } - for (var key in src_33557141) { dest_33557140[key] = src_33557141[key]; } - result_33557151 = dest_33557140; - - break; - case 18: - case 17: - if (!((ti_33557142.base == null))) { - result_33557151 = nimCopy(dest_33557140, src_33557141, ti_33557142.base); - } - else { - if ((ti_33557142.kind == 17)) { - result_33557151 = (dest_33557140 === null || dest_33557140 === undefined) ? {m_type: ti_33557142} : dest_33557140; - } - else { - result_33557151 = (dest_33557140 === null || dest_33557140 === undefined) ? {} : dest_33557140; - } - } - nimCopyAux(result_33557151, src_33557141, ti_33557142.node); - break; - case 24: - case 4: - case 27: - case 16: - if (src_33557141 === null) { - result_33557151 = null; - } - else { - if (dest_33557140 === null || dest_33557140 === undefined || dest_33557140.length != src_33557141.length) { - dest_33557140 = new Array(src_33557141.length); - } - result_33557151 = dest_33557140; - for (var i = 0; i < src_33557141.length; ++i) { - result_33557151[i] = nimCopy(result_33557151[i], src_33557141[i], ti_33557142.base); - } - } - - break; - case 28: - if (src_33557141 !== null) { - result_33557151 = src_33557141.slice(0); - } - - break; - default: - result_33557151 = src_33557141; - break; - } - - return result_33557151; - -} - -function chckIndx(i_33557184, a_33557185, b_33557186) { - var Temporary1; - - var result_33557187 = 0; - - BeforeRet: do { - if (!(a_33557185 <= i_33557184)) Temporary1 = false; else { Temporary1 = (i_33557184 <= b_33557186); } if (Temporary1) { - result_33557187 = i_33557184; - break BeforeRet; - } - else { - raiseIndexError(i_33557184, a_33557185, b_33557186); - } - - } while (false); - - return result_33557187; - -} - -function subInt(a_33556944, b_33556945) { - var result = a_33556944 - b_33556945; - checkOverflowInt(result); - return result; - - - -} -var ConstSet2 = setConstr([65, 90]); -var ConstSet3 = setConstr(95, 32, 46); -var ConstSet4 = setConstr(95, 32, 46); - -function mulInt(a_33556948, b_33556949) { - var result = a_33556948 * b_33556949; - checkOverflowInt(result); - return result; - - - -} -var ConstSet5 = setConstr([97, 122]); -var ConstSet6 = setConstr([65, 90], [97, 122]); -var ConstSet7 = setConstr([97, 122]); -var ConstSet8 = setConstr([65, 90]); -var ConstSet9 = setConstr([65, 90], [97, 122]); - -function nimMax(a_33556998, b_33556999) { - var Temporary1; - - var result_33557000 = 0; - - BeforeRet: do { - if ((b_33556999 <= a_33556998)) { - Temporary1 = a_33556998; - } - else { - Temporary1 = b_33556999; - } - - result_33557000 = Temporary1; - break BeforeRet; - } while (false); - - return result_33557000; - -} - -function nimMin(a_33556994, b_33556995) { - var Temporary1; - - var result_33556996 = 0; - - BeforeRet: do { - if ((a_33556994 <= b_33556995)) { - Temporary1 = a_33556994; - } - else { - Temporary1 = b_33556995; - } - - result_33556996 = Temporary1; - break BeforeRet; - } while (false); - - return result_33556996; - -} - -function addChar(x_33557255, c_33557256) { - x_33557255.push(c_33557256); - - -} -if (!Math.trunc) { - Math.trunc = function(v) { - v = +v; - if (!isFinite(v)) return v; - return (v - v % 1) || (v < 0 ? -0 : v === 0 ? v : 0); - }; -} - -var alternative_469762624 = [null]; - -function add_33556419(x_33556420, x_33556420_Idx, y_33556421) { - if (x_33556420[x_33556420_Idx] === null) { x_33556420[x_33556420_Idx] = []; } - var off = x_33556420[x_33556420_Idx].length; - x_33556420[x_33556420_Idx].length += y_33556421.length; - for (var i = 0; i < y_33556421.length; ++i) { - x_33556420[x_33556420_Idx][off+i] = y_33556421.charCodeAt(i); - } - - - -} - -function newSeq_33556825(len_33556827) { - var result_33556828 = []; - - result_33556828 = new Array(len_33556827); for (var i = 0 ; i < len_33556827 ; ++i) { result_33556828[i] = null; } - return result_33556828; - -} - -function unhandledException(e_33556663) { - var buf_33556664 = [[]]; - if (!(((e_33556663.message).length == 0))) { - buf_33556664[0].push.apply(buf_33556664[0], makeNimstrLit("Error: unhandled exception: "));; - buf_33556664[0].push.apply(buf_33556664[0], e_33556663.message);; - } - else { - buf_33556664[0].push.apply(buf_33556664[0], makeNimstrLit("Error: unhandled exception"));; - } - - buf_33556664[0].push.apply(buf_33556664[0], makeNimstrLit(" ["));; - add_33556419(buf_33556664, 0, e_33556663.name); - buf_33556664[0].push.apply(buf_33556664[0], makeNimstrLit("]\x0A"));; - var cbuf_33556665 = toJSStr(buf_33556664[0]); - framePtr = null; - if (typeof(Error) !== "undefined") { - throw new Error(cbuf_33556665); - } - else { - throw cbuf_33556665; - } - - - -} - -function raiseOverflow() { - raiseException({message: makeNimstrLit("over- or underflow"), parent: null, m_type: NTI33555122, name: null, trace: [], up: null}, "OverflowDefect"); - - -} - -function checkOverflowInt(a_33556938) { - if (a_33556938 > 2147483647 || a_33556938 < -2147483648) raiseOverflow(); - - - -} - -function isWhitespace_469762356(text_469762357) { - return !/[^\s]/.test(text_469762357); - - - -} - -function isWhitespace_469762359(x_469762360) { - var Temporary1; - var Temporary2; - - var result_469762361 = false; - - if (!(x_469762360.nodeName == "#text")) Temporary2 = false; else { Temporary2 = isWhitespace_469762356(x_469762360.textContent); } if (Temporary2) Temporary1 = true; else { Temporary1 = (x_469762360.nodeName == "#comment"); } result_469762361 = Temporary1; - - return result_469762361; - -} - -function raiseRangeError() { - raiseException({message: makeNimstrLit("value out of range"), parent: null, m_type: NTI33555130, name: null, trace: [], up: null}, "RangeDefect"); - - -} - -function addChars_251658415(result_251658417, result_251658417_Idx, x_251658418, start_251658419, n_251658420) { - var old_251658421 = (result_251658417[result_251658417_Idx]).length; - (result_251658417[result_251658417_Idx].length = chckRange(addInt(old_251658421, n_251658420), 0, 2147483647)); - Label1: do { - var iHEX60gensym4_251658435 = 0; - var i_469762674 = 0; - Label2: do { - Label3: while (true) { - if (!(i_469762674 < n_251658420)) break Label3; - iHEX60gensym4_251658435 = i_469762674; - result_251658417[result_251658417_Idx][chckIndx(addInt(old_251658421, iHEX60gensym4_251658435), 0, (result_251658417[result_251658417_Idx]).length - 1)] = x_251658418.charCodeAt(chckIndx(addInt(start_251658419, iHEX60gensym4_251658435), 0, (x_251658418).length - 1)); - i_469762674 = addInt(i_469762674, 1); - } - } while (false); - } while (false); - - -} - -function addChars_251658411(result_251658413, result_251658413_Idx, x_251658414) { - addChars_251658415(result_251658413, result_251658413_Idx, x_251658414, 0, ((x_251658414) == null ? 0 : (x_251658414).length)); - - -} - -function addInt_251658436(result_251658437, result_251658437_Idx, x_251658438) { - addChars_251658411(result_251658437, result_251658437_Idx, ((x_251658438) + "")); - - -} - -function addInt_251658457(result_251658458, result_251658458_Idx, x_251658459) { - addInt_251658436(result_251658458, result_251658458_Idx, x_251658459); - - -} - -function HEX24_335544323(x_335544324) { - var result_335544325 = [[]]; - - addInt_251658457(result_335544325, 0, x_335544324); - - return result_335544325[0]; - -} - -function isFatPointer_33557131(ti_33557132) { - var result_33557133 = false; - - BeforeRet: do { - result_33557133 = !((ConstSet1[ti_33557132.base.kind] != undefined)); - break BeforeRet; - } while (false); - - return result_33557133; - -} - -function nimCopyAux(dest_33557144, src_33557145, n_33557146) { - switch (n_33557146.kind) { - case 0: - break; - case 1: - dest_33557144[n_33557146.offset] = nimCopy(dest_33557144[n_33557146.offset], src_33557145[n_33557146.offset], n_33557146.typ); - - break; - case 2: - for (var i = 0; i < n_33557146.sons.length; i++) { - nimCopyAux(dest_33557144, src_33557145, n_33557146.sons[i]); - } - - break; - case 3: - dest_33557144[n_33557146.offset] = nimCopy(dest_33557144[n_33557146.offset], src_33557145[n_33557146.offset], n_33557146.typ); - for (var i = 0; i < n_33557146.sons.length; ++i) { - nimCopyAux(dest_33557144, src_33557145, n_33557146.sons[i][1]); - } - - break; - } - - -} - -function raiseIndexError(i_33556754, a_33556755, b_33556756) { - var Temporary1; - - if ((b_33556756 < a_33556755)) { - Temporary1 = makeNimstrLit("index out of bounds, the container is empty"); - } - else { - Temporary1 = (makeNimstrLit("index ") || []).concat(HEX24_335544323(i_33556754) || [],makeNimstrLit(" not in ") || [],HEX24_335544323(a_33556755) || [],makeNimstrLit(" .. ") || [],HEX24_335544323(b_33556756) || []); - } - - raiseException({message: nimCopy(null, Temporary1, NTI33554439), parent: null, m_type: NTI33555128, name: null, trace: [], up: null}, "IndexDefect"); - - -} - -function toToc_469762362(x_469762363, father_469762364) { - var Temporary5; - var Temporary6; - var Temporary7; - var Temporary8; - var Temporary15; - - if ((x_469762363.nodeName == "UL")) { - var f_469762372 = {heading: null, kids: [], sortId: (father_469762364.kids).length, doSort: false}; - var i_469762373 = 0; - Label1: do { - Label2: while (true) { - if (!(i_469762373 < x_469762363.childNodes.length)) break Label2; - var nxt_469762374 = addInt(i_469762373, 1); - Label3: do { - Label4: while (true) { - if (!(nxt_469762374 < x_469762363.childNodes.length)) Temporary5 = false; else { Temporary5 = isWhitespace_469762359(x_469762363.childNodes[nxt_469762374]); } if (!Temporary5) break Label4; - nxt_469762374 = addInt(nxt_469762374, 1); - } - } while (false); - if (!(nxt_469762374 < x_469762363.childNodes.length)) Temporary8 = false; else { Temporary8 = (x_469762363.childNodes[i_469762373].nodeName == "LI"); } if (!Temporary8) Temporary7 = false; else { Temporary7 = (x_469762363.childNodes[i_469762373].childNodes.length == 1); } if (!Temporary7) Temporary6 = false; else { Temporary6 = (x_469762363.childNodes[nxt_469762374].nodeName == "UL"); } if (Temporary6) { - var e_469762386 = {heading: x_469762363.childNodes[i_469762373].childNodes[0], kids: [], sortId: (f_469762372.kids).length, doSort: false}; - var it_469762387 = x_469762363.childNodes[nxt_469762374]; - Label9: do { - var j_469762392 = 0; - var colontmp__469762653 = 0; - colontmp__469762653 = it_469762387.childNodes.length; - var i_469762654 = 0; - Label10: do { - Label11: while (true) { - if (!(i_469762654 < colontmp__469762653)) break Label11; - j_469762392 = i_469762654; - toToc_469762362(it_469762387.childNodes[j_469762392], e_469762386); - i_469762654 = addInt(i_469762654, 1); - } - } while (false); - } while (false); - f_469762372.kids.push(e_469762386);; - i_469762373 = addInt(nxt_469762374, 1); - } - else { - toToc_469762362(x_469762363.childNodes[i_469762373], f_469762372); - i_469762373 = addInt(i_469762373, 1); - } - - } - } while (false); - father_469762364.kids.push(f_469762372);; - } - else { - if (isWhitespace_469762359(x_469762363)) { - } - else { - if ((x_469762363.nodeName == "LI")) { - var idx_469762409 = []; - Label12: do { - var i_469762414 = 0; - var colontmp__469762657 = 0; - colontmp__469762657 = x_469762363.childNodes.length; - var i_469762658 = 0; - Label13: do { - Label14: while (true) { - if (!(i_469762658 < colontmp__469762657)) break Label14; - i_469762414 = i_469762658; - if (!(isWhitespace_469762359(x_469762363.childNodes[i_469762414]))) { - idx_469762409.push(i_469762414);; - } - - i_469762658 = addInt(i_469762658, 1); - } - } while (false); - } while (false); - if (!((idx_469762409).length == 2)) Temporary15 = false; else { Temporary15 = (x_469762363.childNodes[idx_469762409[chckIndx(1, 0, (idx_469762409).length - 1)]].nodeName == "UL"); } if (Temporary15) { - var e_469762430 = {heading: x_469762363.childNodes[idx_469762409[chckIndx(0, 0, (idx_469762409).length - 1)]], kids: [], sortId: (father_469762364.kids).length, doSort: false}; - var it_469762431 = x_469762363.childNodes[idx_469762409[chckIndx(1, 0, (idx_469762409).length - 1)]]; - Label16: do { - var j_469762436 = 0; - var colontmp__469762661 = 0; - colontmp__469762661 = it_469762431.childNodes.length; - var i_469762662 = 0; - Label17: do { - Label18: while (true) { - if (!(i_469762662 < colontmp__469762661)) break Label18; - j_469762436 = i_469762662; - toToc_469762362(it_469762431.childNodes[j_469762436], e_469762430); - i_469762662 = addInt(i_469762662, 1); - } - } while (false); - } while (false); - father_469762364.kids.push(e_469762430);; - } - else { - Label19: do { - var i_469762445 = 0; - var colontmp__469762665 = 0; - colontmp__469762665 = x_469762363.childNodes.length; - var i_469762666 = 0; - Label20: do { - Label21: while (true) { - if (!(i_469762666 < colontmp__469762665)) break Label21; - i_469762445 = i_469762666; - toToc_469762362(x_469762363.childNodes[i_469762445], father_469762364); - i_469762666 = addInt(i_469762666, 1); - } - } while (false); - } while (false); - } - - } - else { - father_469762364.kids.push({heading: x_469762363, kids: [], sortId: (father_469762364.kids).length, doSort: false});; - } - }} - - -} - -function extractItems_469762182(x_469762183, heading_469762184, items_469762185, items_469762185_Idx) { - var Temporary1; - - BeforeRet: do { - if ((x_469762183 == null)) { - break BeforeRet; - } - - if (!!((x_469762183.heading == null))) Temporary1 = false; else { Temporary1 = (x_469762183.heading.textContent == heading_469762184); } if (Temporary1) { - Label2: do { - var i_469762202 = 0; - var colontmp__469762677 = 0; - colontmp__469762677 = (x_469762183.kids).length; - var i_469762678 = 0; - Label3: do { - Label4: while (true) { - if (!(i_469762678 < colontmp__469762677)) break Label4; - i_469762202 = i_469762678; - items_469762185[items_469762185_Idx].push(x_469762183.kids[chckIndx(i_469762202, 0, (x_469762183.kids).length - 1)].heading);; - i_469762678 = addInt(i_469762678, 1); - } - } while (false); - } while (false); - } - else { - Label5: do { - var i_469762214 = 0; - var colontmp__469762681 = 0; - colontmp__469762681 = (x_469762183.kids).length; - var i_469762682 = 0; - Label6: do { - Label7: while (true) { - if (!(i_469762682 < colontmp__469762681)) break Label7; - i_469762214 = i_469762682; - var it_469762215 = x_469762183.kids[chckIndx(i_469762214, 0, (x_469762183.kids).length - 1)]; - extractItems_469762182(it_469762215, heading_469762184, items_469762185, items_469762185_Idx); - i_469762682 = addInt(i_469762682, 1); - } - } while (false); - } while (false); - } - - } while (false); - - -} - -function tree_469762055(tag_469762056, kids_469762057) { - var result_469762058 = null; - - result_469762058 = document.createElement(toJSStr(tag_469762056)); - Label1: do { - var k_469762071 = null; - var i_469762695 = 0; - Label2: do { - Label3: while (true) { - if (!(i_469762695 < (kids_469762057).length)) break Label3; - k_469762071 = kids_469762057[chckIndx(i_469762695, 0, (kids_469762057).length - 1)]; - result_469762058.appendChild(k_469762071); - i_469762695 = addInt(i_469762695, 1); - } - } while (false); - } while (false); - - return result_469762058; - -} - -function text_469762109(s_469762110) { - var result_469762111 = null; - - result_469762111 = document.createTextNode(s_469762110); - - return result_469762111; - -} - -function sysFatal_218103842(message_218103845) { - raiseException({message: nimCopy(null, message_218103845, NTI33554439), m_type: NTI33555124, parent: null, name: null, trace: [], up: null}, "AssertionDefect"); - - -} - -function raiseAssert_218103840(msg_218103841) { - sysFatal_218103842(msg_218103841); - - -} - -function failedAssertImpl_218103864(msg_218103865) { - raiseAssert_218103840(msg_218103865); - - -} - -function uncovered_469762493(x_469762494) { - var Temporary1; - var Temporary2; - - var result_469762495 = null; - - BeforeRet: do { - if (!((x_469762494.kids).length == 0)) Temporary1 = false; else { Temporary1 = !((x_469762494.heading == null)); } if (Temporary1) { - if (!(x_469762494.heading.hasOwnProperty('__karaxMarker__'))) { - Temporary2 = x_469762494; - } - else { - Temporary2 = null; - } - - result_469762495 = Temporary2; - break BeforeRet; - } - - result_469762495 = {heading: x_469762494.heading, kids: [], sortId: x_469762494.sortId, doSort: x_469762494.doSort}; - Label3: do { - var i_469762514 = 0; - var colontmp__469762702 = 0; - colontmp__469762702 = (x_469762494.kids).length; - var i_469762703 = 0; - Label4: do { - Label5: while (true) { - if (!(i_469762703 < colontmp__469762702)) break Label5; - i_469762514 = i_469762703; - var y_469762515 = uncovered_469762493(x_469762494.kids[chckIndx(i_469762514, 0, (x_469762494.kids).length - 1)]); - if (!((y_469762515 == null))) { - result_469762495.kids.push(y_469762515);; - } - - i_469762703 = addInt(i_469762703, 1); - } - } while (false); - } while (false); - if (((result_469762495.kids).length == 0)) { - result_469762495 = null; - } - - } while (false); - - return result_469762495; - -} - -function mergeTocs_469762527(orig_469762528, news_469762529) { - var result_469762530 = null; - - result_469762530 = uncovered_469762493(orig_469762528); - if ((result_469762530 == null)) { - result_469762530 = news_469762529; - } - else { - Label1: do { - var i_469762542 = 0; - var colontmp__469762698 = 0; - colontmp__469762698 = (news_469762529.kids).length; - var i_469762699 = 0; - Label2: do { - Label3: while (true) { - if (!(i_469762699 < colontmp__469762698)) break Label3; - i_469762542 = i_469762699; - result_469762530.kids.push(news_469762529.kids[chckIndx(i_469762542, 0, (news_469762529.kids).length - 1)]);; - i_469762699 = addInt(i_469762699, 1); - } - } while (false); - } while (false); - } - - - return result_469762530; - -} - -function buildToc_469762547(orig_469762548, types_469762549, procs_469762550) { - var Temporary7; - - var result_469762551 = null; - - var newStuff_469762556 = {heading: null, kids: [], doSort: true, sortId: 0}; - Label1: do { - var t_469762578 = null; - var i_469762690 = 0; - var L_469762691 = (types_469762549).length; - Label2: do { - Label3: while (true) { - if (!(i_469762690 < L_469762691)) break Label3; - t_469762578 = types_469762549[chckIndx(i_469762690, 0, (types_469762549).length - 1)]; - var c_469762583 = {heading: t_469762578.cloneNode(true), kids: [], doSort: true, sortId: 0}; - t_469762578.__karaxMarker__ = true; - Label4: do { - var p_469762587 = null; - var i_469762687 = 0; - var L_469762688 = (procs_469762550).length; - Label5: do { - Label6: while (true) { - if (!(i_469762687 < L_469762688)) break Label6; - p_469762587 = procs_469762550[chckIndx(i_469762687, 0, (procs_469762550).length - 1)]; - if (!(p_469762587.hasOwnProperty('__karaxMarker__'))) { - var xx_469762588 = p_469762587.parentNode.getElementsByClassName("attachedType"); - if (!((xx_469762588).length == 1)) Temporary7 = false; else { Temporary7 = (xx_469762588[chckIndx(0, 0, (xx_469762588).length - 1)].textContent == t_469762578.textContent); } if (Temporary7) { - var q_469762593 = tree_469762055(makeNimstrLit("A"), [text_469762109(p_469762587.title)]); - q_469762593.setAttribute("href", p_469762587.getAttribute("href")); - c_469762583.kids.push({heading: q_469762593, kids: [], sortId: 0, doSort: false});; - p_469762587.__karaxMarker__ = true; - } - - } - - i_469762687 = addInt(i_469762687, 1); - if (!(((procs_469762550).length == L_469762688))) { - failedAssertImpl_218103864(makeNimstrLit("iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - } while (false); - } while (false); - newStuff_469762556.kids.push(c_469762583);; - i_469762690 = addInt(i_469762690, 1); - if (!(((types_469762549).length == L_469762691))) { - failedAssertImpl_218103864(makeNimstrLit("iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - } while (false); - } while (false); - result_469762551 = mergeTocs_469762527(orig_469762548, newStuff_469762556); - - return result_469762551; - -} - -function add_469762099(parent_469762100, kid_469762101) { - var Temporary1; - var Temporary2; - - if (!(parent_469762100.nodeName == "TR")) Temporary1 = false; else { if ((kid_469762101.nodeName == "TD")) Temporary2 = true; else { Temporary2 = (kid_469762101.nodeName == "TH"); } Temporary1 = Temporary2; } if (Temporary1) { - var k_469762102 = document.createElement("TD"); - k_469762102.appendChild(kid_469762101); - parent_469762100.appendChild(k_469762102); - } - else { - parent_469762100.appendChild(kid_469762101); - } - - - -} - -function setClass_469762103(e_469762104, value_469762105) { - e_469762104.setAttribute("class", toJSStr(value_469762105)); - - -} - -function toHtml_469762225(x_469762226, isRoot_469762227) { - var Temporary1; - -function HEX3Aanonymous_469762245(a_469762246, b_469762247) { - var Temporary1; - - var result_469762248 = 0; - - BeforeRet: do { - if (!!((a_469762246.heading == null))) Temporary1 = false; else { Temporary1 = !((b_469762247.heading == null)); } if (Temporary1) { - var x_469762257 = a_469762246.heading.textContent; - var y_469762258 = b_469762247.heading.textContent; - if ((x_469762257 < y_469762258)) { - result_469762248 = -1; - break BeforeRet; - } - - if ((y_469762258 < x_469762257)) { - result_469762248 = 1; - break BeforeRet; - } - - result_469762248 = 0; - break BeforeRet; - } - else { - result_469762248 = subInt(a_469762246.sortId, b_469762247.sortId); - break BeforeRet; - } - - } while (false); - - return result_469762248; - - } - - var result_469762228 = null; - - BeforeRet: do { - if ((x_469762226 == null)) { - result_469762228 = null; - break BeforeRet; - } - - if (((x_469762226.kids).length == 0)) { - if ((x_469762226.heading == null)) { - result_469762228 = null; - break BeforeRet; - } - - result_469762228 = x_469762226.heading.cloneNode(true); - break BeforeRet; - } - - result_469762228 = tree_469762055(makeNimstrLit("DIV"), []); - if (!!((x_469762226.heading == null))) Temporary1 = false; else { Temporary1 = !(x_469762226.heading.hasOwnProperty('__karaxMarker__')); } if (Temporary1) { - add_469762099(result_469762228, x_469762226.heading.cloneNode(true)); - } - - var ul_469762244 = tree_469762055(makeNimstrLit("UL"), []); - if (isRoot_469762227) { - setClass_469762103(ul_469762244, makeNimstrLit("simple simple-toc")); - } - else { - setClass_469762103(ul_469762244, makeNimstrLit("simple")); - } - - if (x_469762226.doSort) { - x_469762226.kids.sort(HEX3Aanonymous_469762245); - } - - Label2: do { - var k_469762287 = null; - var i_469762707 = 0; - var L_469762708 = (x_469762226.kids).length; - Label3: do { - Label4: while (true) { - if (!(i_469762707 < L_469762708)) break Label4; - k_469762287 = x_469762226.kids[chckIndx(i_469762707, 0, (x_469762226.kids).length - 1)]; - var y_469762288 = toHtml_469762225(k_469762287, false); - if (!((y_469762288 == null))) { - add_469762099(ul_469762244, tree_469762055(makeNimstrLit("LI"), [y_469762288])); - } - - i_469762707 = addInt(i_469762707, 1); - if (!(((x_469762226.kids).length == L_469762708))) { - failedAssertImpl_218103864(makeNimstrLit("iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - } while (false); - } while (false); - if (!((ul_469762244.childNodes.length == 0))) { - add_469762099(result_469762228, ul_469762244); - } - - if ((result_469762228.childNodes.length == 0)) { - result_469762228 = null; - } - - } while (false); - - return result_469762228; - -} - -function replaceById_469762114(id_469762115, newTree_469762116) { - var x_469762117 = document.getElementById(id_469762115); - x_469762117.parentNode.replaceChild(newTree_469762116, x_469762117); - newTree_469762116.id = id_469762115; - - -} - -function togglevis_469762625(d_469762626) { - if (d_469762626.style.display == 'none') - d_469762626.style.display = 'inline'; - else - d_469762626.style.display = 'none'; - - - -} - -function groupBy(value_469762628) { - var toc_469762629 = document.getElementById("toc-list"); - if ((alternative_469762624[0] == null)) { - var tt_469762637 = {heading: null, kids: [], sortId: 0, doSort: false}; - toToc_469762362(toc_469762629, tt_469762637); - tt_469762637 = tt_469762637.kids[chckIndx(0, 0, (tt_469762637.kids).length - 1)]; - var types_469762642 = [[]]; - var procs_469762647 = [[]]; - extractItems_469762182(tt_469762637, "Types", types_469762642, 0); - extractItems_469762182(tt_469762637, "Procs", procs_469762647, 0); - extractItems_469762182(tt_469762637, "Converters", procs_469762647, 0); - extractItems_469762182(tt_469762637, "Methods", procs_469762647, 0); - extractItems_469762182(tt_469762637, "Templates", procs_469762647, 0); - extractItems_469762182(tt_469762637, "Macros", procs_469762647, 0); - extractItems_469762182(tt_469762637, "Iterators", procs_469762647, 0); - var ntoc_469762648 = buildToc_469762547(tt_469762637, types_469762642[0], procs_469762647[0]); - var x_469762649 = toHtml_469762225(ntoc_469762648, true); - alternative_469762624[0] = tree_469762055(makeNimstrLit("DIV"), [x_469762649]); - } - - if ((value_469762628 == "type")) { - replaceById_469762114("tocRoot", alternative_469762624[0]); - } - else { - replaceById_469762114("tocRoot", tree_469762055(makeNimstrLit("DIV"), [])); - } - - togglevis_469762625(document.getElementById("toc-list")); - - -} -var db_469762710 = [[]]; -var contents_469762711 = [[]]; -var oldtoc_469762858 = [null]; -var timer_469762859 = [null]; - -function nsuToLowerAsciiChar(c_637534276) { - var result_637534277 = 0; - - if ((ConstSet2[c_637534276] != undefined)) { - result_637534277 = (c_637534276 ^ 32); - } - else { - result_637534277 = c_637534276; - } - - - return result_637534277; - -} - -function fuzzyMatch_620757008(pattern_620757009, str_620757010) { - var Temporary4; - var Temporary5; - var Temporary6; - var Temporary7; - var Temporary8; - - var result_620757013 = {Field0: 0, Field1: false}; - - var scoreState_620757014 = -100; - var headerMatched_620757015 = false; - var unmatchedLeadingCharCount_620757016 = 0; - var consecutiveMatchCount_620757017 = 0; - var strIndex_620757018 = 0; - var patIndex_620757019 = 0; - var score_620757020 = 0; - Label1: do { - Label2: while (true) { - if (!((strIndex_620757018 < ((str_620757010) == null ? 0 : (str_620757010).length)) && (patIndex_620757019 < ((pattern_620757009) == null ? 0 : (pattern_620757009).length)))) break Label2; - Label3: do { - var patternChar_620757023 = nsuToLowerAsciiChar(pattern_620757009.charCodeAt(chckIndx(patIndex_620757019, 0, (pattern_620757009).length - 1))); - var strChar_620757024 = nsuToLowerAsciiChar(str_620757010.charCodeAt(chckIndx(strIndex_620757018, 0, (str_620757010).length - 1))); - if ((ConstSet3[patternChar_620757023] != undefined)) { - patIndex_620757019 = addInt(patIndex_620757019, 1); - break Label3; - } - - if ((ConstSet4[strChar_620757024] != undefined)) { - strIndex_620757018 = addInt(strIndex_620757018, 1); - break Label3; - } - - if ((!(headerMatched_620757015) && (strChar_620757024 == 58))) { - headerMatched_620757015 = true; - scoreState_620757014 = -100; - score_620757020 = ((Math.floor((0.5 * score_620757020))) | 0); - patIndex_620757019 = 0; - strIndex_620757018 = addInt(strIndex_620757018, 1); - break Label3; - } - - if ((strChar_620757024 == patternChar_620757023)) { - switch (scoreState_620757014) { - case -100: - case 20: - scoreState_620757014 = 10; - break; - case 0: - scoreState_620757014 = 5; - score_620757020 = addInt(score_620757020, scoreState_620757014); - break; - case 10: - case 5: - consecutiveMatchCount_620757017 = addInt(consecutiveMatchCount_620757017, 1); - scoreState_620757014 = 5; - score_620757020 = addInt(score_620757020, mulInt(5, consecutiveMatchCount_620757017)); - if ((scoreState_620757014 == 10)) { - score_620757020 = addInt(score_620757020, 10); - } - - var onBoundary_620757076 = (patIndex_620757019 == ((pattern_620757009) == null ? -1 : (pattern_620757009).length - 1)); - if ((!(onBoundary_620757076) && (strIndex_620757018 < ((str_620757010) == null ? -1 : (str_620757010).length - 1)))) { - var nextPatternChar_620757077 = nsuToLowerAsciiChar(pattern_620757009.charCodeAt(chckIndx(addInt(patIndex_620757019, 1), 0, (pattern_620757009).length - 1))); - var nextStrChar_620757078 = nsuToLowerAsciiChar(str_620757010.charCodeAt(chckIndx(addInt(strIndex_620757018, 1), 0, (str_620757010).length - 1))); - if (!!((ConstSet5[nextStrChar_620757078] != undefined))) Temporary4 = false; else { Temporary4 = !((nextStrChar_620757078 == nextPatternChar_620757077)); } onBoundary_620757076 = Temporary4; - } - - if (onBoundary_620757076) { - scoreState_620757014 = 20; - score_620757020 = addInt(score_620757020, scoreState_620757014); - } - - break; - case -1: - case -3: - if (!((ConstSet6[str_620757010.charCodeAt(chckIndx(subInt(strIndex_620757018, 1), 0, (str_620757010).length - 1))] != undefined))) Temporary5 = true; else { if (!(ConstSet7[str_620757010.charCodeAt(chckIndx(subInt(strIndex_620757018, 1), 0, (str_620757010).length - 1))] != undefined)) Temporary6 = false; else { Temporary6 = (ConstSet8[str_620757010.charCodeAt(chckIndx(strIndex_620757018, 0, (str_620757010).length - 1))] != undefined); } Temporary5 = Temporary6; } var isLeadingChar_620757102 = Temporary5; - if (isLeadingChar_620757102) { - scoreState_620757014 = 10; - } - else { - scoreState_620757014 = 0; - score_620757020 = addInt(score_620757020, scoreState_620757014); - } - - break; - } - patIndex_620757019 = addInt(patIndex_620757019, 1); - } - else { - switch (scoreState_620757014) { - case -100: - scoreState_620757014 = -3; - score_620757020 = addInt(score_620757020, scoreState_620757014); - break; - case 5: - scoreState_620757014 = -1; - score_620757020 = addInt(score_620757020, scoreState_620757014); - consecutiveMatchCount_620757017 = 0; - break; - case -3: - if ((unmatchedLeadingCharCount_620757016 < 3)) { - scoreState_620757014 = -3; - score_620757020 = addInt(score_620757020, scoreState_620757014); - } - - unmatchedLeadingCharCount_620757016 = addInt(unmatchedLeadingCharCount_620757016, 1); - break; - default: - scoreState_620757014 = -1; - score_620757020 = addInt(score_620757020, scoreState_620757014); - break; - } - } - - strIndex_620757018 = addInt(strIndex_620757018, 1); - } while (false); - } - } while (false); - if (!(patIndex_620757019 == ((pattern_620757009) == null ? 0 : (pattern_620757009).length))) Temporary7 = false; else { if ((strIndex_620757018 == ((str_620757010) == null ? 0 : (str_620757010).length))) Temporary8 = true; else { Temporary8 = !((ConstSet9[str_620757010.charCodeAt(chckIndx(strIndex_620757018, 0, (str_620757010).length - 1))] != undefined)); } Temporary7 = Temporary8; } if (Temporary7) { - score_620757020 = addInt(score_620757020, 10); - } - - var colontmp__469762919 = nimMax(0, score_620757020); - var colontmp__469762920 = (0 < score_620757020); - result_620757013 = nimCopy(result_620757013, {Field0: colontmp__469762919, Field1: colontmp__469762920}, NTI620757006); - - return result_620757013; - -} - -function escapeCString_469762714(x_469762715, x_469762715_Idx) { - var s_469762716 = []; - Label1: do { - var c_469762717 = 0; - var iHEX60gensym6_469762923 = 0; - var nHEX60gensym6_469762924 = ((x_469762715[x_469762715_Idx]) == null ? 0 : (x_469762715[x_469762715_Idx]).length); - Label2: do { - Label3: while (true) { - if (!(iHEX60gensym6_469762923 < nHEX60gensym6_469762924)) break Label3; - c_469762717 = x_469762715[x_469762715_Idx].charCodeAt(chckIndx(iHEX60gensym6_469762923, 0, (x_469762715[x_469762715_Idx]).length - 1)); - switch (c_469762717) { - case 60: - s_469762716.push.apply(s_469762716, makeNimstrLit("<"));; - break; - case 62: - s_469762716.push.apply(s_469762716, makeNimstrLit(">"));; - break; - default: - addChar(s_469762716, c_469762717);; - break; - } - iHEX60gensym6_469762923 = addInt(iHEX60gensym6_469762923, 1); - } - } while (false); - } while (false); - x_469762715[x_469762715_Idx] = toJSStr(s_469762716); - - -} - -function text_469762106(s_469762107) { - var result_469762108 = null; - - result_469762108 = document.createTextNode(toJSStr(s_469762107)); - - return result_469762108; - -} - -function dosearch_469762718(value_469762719) { - -function HEX3Aanonymous_469762775(a_469762780, b_469762781) { - var result_469762786 = 0; - - result_469762786 = subInt(b_469762781["Field1"], a_469762780["Field1"]); - - return result_469762786; - - } - - var result_469762720 = null; - - if (((db_469762710[0]).length == 0)) { - var stuff_469762724 = null; - var request = new XMLHttpRequest(); - request.open("GET", "theindex.html", false); - request.send(null); - - var doc = document.implementation.createHTMLDocument("theindex"); - doc.documentElement.innerHTML = request.responseText; - - //parser=new DOMParser(); - //doc=parser.parseFromString("", "text/html"); - - stuff_469762724 = doc.documentElement; - - db_469762710[0] = nimCopy(null, stuff_469762724.getElementsByClassName("reference"), NTI603980220); - contents_469762711[0] = nimCopy(null, [], NTI469762606); - Label1: do { - var ahref_469762749 = null; - var i_469762904 = 0; - var L_469762905 = (db_469762710[0]).length; - Label2: do { - Label3: while (true) { - if (!(i_469762904 < L_469762905)) break Label3; - ahref_469762749 = db_469762710[0][chckIndx(i_469762904, 0, (db_469762710[0]).length - 1)]; - contents_469762711[0].push(ahref_469762749.getAttribute("data-doc-search-tag"));; - i_469762904 = addInt(i_469762904, 1); - if (!(((db_469762710[0]).length == L_469762905))) { - failedAssertImpl_218103864(makeNimstrLit("iterators.nim(240, 11) `len(a) == L` the length of the seq changed while iterating over it")); - } - - } - } while (false); - } while (false); - } - - var ul_469762754 = tree_469762055(makeNimstrLit("UL"), []); - result_469762720 = tree_469762055(makeNimstrLit("DIV"), []); - setClass_469762103(result_469762720, makeNimstrLit("search_results")); - var matches_469762759 = []; - Label4: do { - var i_469762767 = 0; - var colontmp__469762909 = 0; - colontmp__469762909 = (db_469762710[0]).length; - var i_469762910 = 0; - Label5: do { - Label6: while (true) { - if (!(i_469762910 < colontmp__469762909)) break Label6; - i_469762767 = i_469762910; - Label7: do { - var c_469762768 = contents_469762711[0][chckIndx(i_469762767, 0, (contents_469762711[0]).length - 1)]; - if (((c_469762768 == "Examples") || (c_469762768 == "PEG construction"))) { - break Label7; - } - - var colontmp__469762916 = fuzzyMatch_620757008(value_469762719, c_469762768); - var score_469762769 = colontmp__469762916["Field0"]; - var matched_469762770 = colontmp__469762916["Field1"]; - if (matched_469762770) { - matches_469762759.push({Field0: db_469762710[0][chckIndx(i_469762767, 0, (db_469762710[0]).length - 1)], Field1: score_469762769});; - } - - } while (false); - i_469762910 = addInt(i_469762910, 1); - } - } while (false); - } while (false); - matches_469762759.sort(HEX3Aanonymous_469762775); - Label8: do { - var i_469762803 = 0; - var colontmp__469762913 = 0; - colontmp__469762913 = nimMin((matches_469762759).length, 29); - var i_469762914 = 0; - Label9: do { - Label10: while (true) { - if (!(i_469762914 < colontmp__469762913)) break Label10; - i_469762803 = i_469762914; - matches_469762759[chckIndx(i_469762803, 0, (matches_469762759).length - 1)]["Field0"].innerHTML = matches_469762759[chckIndx(i_469762803, 0, (matches_469762759).length - 1)]["Field0"].getAttribute("data-doc-search-tag"); - escapeCString_469762714(matches_469762759[chckIndx(i_469762803, 0, (matches_469762759).length - 1)]["Field0"], "innerHTML"); - add_469762099(ul_469762754, tree_469762055(makeNimstrLit("LI"), [matches_469762759[chckIndx(i_469762803, 0, (matches_469762759).length - 1)]["Field0"]])); - i_469762914 = addInt(i_469762914, 1); - } - } while (false); - } while (false); - if ((ul_469762754.childNodes.length == 0)) { - add_469762099(result_469762720, tree_469762055(makeNimstrLit("B"), [text_469762106(makeNimstrLit("no search results"))])); - } - else { - add_469762099(result_469762720, tree_469762055(makeNimstrLit("B"), [text_469762106(makeNimstrLit("search results"))])); - add_469762099(result_469762720, ul_469762754); - } - - - return result_469762720; - -} - -function search() { - -function wrapper_469762870() { - var elem_469762871 = document.getElementById("searchInput"); - var value_469762872 = elem_469762871.value; - if (!((((value_469762872) == null ? 0 : (value_469762872).length) == 0))) { - if ((oldtoc_469762858[0] == null)) { - oldtoc_469762858[0] = document.getElementById("tocRoot"); - } - - var results_469762876 = dosearch_469762718(value_469762872); - replaceById_469762114("tocRoot", results_469762876); - } - else { - if (!((oldtoc_469762858[0] == null))) { - replaceById_469762114("tocRoot", oldtoc_469762858[0]); - } - } - - - } - - if (!((timer_469762859[0] == null))) { - clearTimeout(timer_469762859[0]); - } - - timer_469762859[0] = setTimeout(wrapper_469762870, 400); - - -} diff --git a/docs/langref.md b/docs/langref.md deleted file mode 100644 index eee6f887..00000000 --- a/docs/langref.md +++ /dev/null @@ -1,113 +0,0 @@ -# Con4m Language syntax reference - -This document is a syntax reference for the Con4m language. It’s a simple syntax that anyone with even minimal programming experience should be able to pick up. - -The language is designed to be fast, and currently does not have any features that might lead to an infinite loop (or infinite recursion). If such features are added, they will be optional. - -[Go back to the home page.](https://github.com/crashappsec/con4m) - -# EBNF specification - -Major lexical elements are are all-uppercase here. Minor ones are inlined, in double quotes. Note that all comment and white space tokens, other than newlines, are always ignored. Newlines -are ignored in most expression contexts (they’re only used to separate statements where there would otherwise be ambiguity). - -```ebnf -top ::= (sectBodyItems | enum | funcDecl) * -body ::= sectBodyItems * -coreBodyItems ::= attrAssign | varAssign | ifStmt | forStmt | continueStmt | - breakStmt | returnStmt | varStmt | exportSmt | - expression (NL|";")+ -sectBodyItems ::= coreBodyItems | section -enum ::= "enum" ID ("," ID)* -attrAssign ::= ("~")? ID("." ID)* ("="|":") expression (NL|";")+ -varAssign ::= ID ("," ID)* ":=" expression (NL|";")+ -section ::= ID (STR | ID)? "{" body "}" -ifStmt ::= "if" expression "{" body "}" - ("elif" expression "{" body "}")* - ("else" expression "{" body" "}")? -forStmt ::= "for" ID "from" expression "to" expression "{" body "}" -continueStmt ::= "continue" (";")? -breakStmt ::= "break" (";")? -returnStmt ::= "return" expression? (";")? -funcDecl ::= "func" ID formalSpec fnBody -formalSpec ::= "(" (paramSpec? ("," paramSpec)* ")" -paramSpec ::= ID (":" typeSpec) -varDeclItem ::= ID ("," ID)* ":" typeSpec -varStmt ::= "var" varDeclItem ("," varDeclItem)* -exportStmt ::= "export" ID ("," ID)* -typeSpec ::= "int" | "string" | "float" | "[" typeSpec "]" | - "{" typeSpec "}" | "(" typeSpec, (typeSpec)+ ")" -fnBody ::= "{" coreBodyItems* "}" -# Note that literal matches before accessExpr, so a lparen at an exprStart -# or in a unaryExpr will be treated as a tuple literal. -exprStart ::= unaryExpr | notExpr | literal | accessExpr -unaryExpr ::= ("+" | "-") (literal | accessExpr) -notExpr ::= ("!" | "not") expression -literal ::= NUM | STR | listLiteral | dictLiteral | tupleLiteral | - TRUE | FALSE | NULL | typeLiteral | cbLiteral -accessExpr ::= (ID | parenExpr) (memberExpr | indexExpr | callActuals)* -tupleLiteral ::= "(" expression ("," expression)*)+ ")" -listLiteral ::= "[" (expression ("," expression)* )? "]" -dictLiteral ::= "{" (expression ":" expression - ("," expression ":" expression)*) "}" -typeLiteral ::= "type" ":" typeSpec -cbLiteral ::= "callback" ":" ID -parenExpr ::= "(" expression ")" -memberExpr ::= "." ID -indexExpr ::= "[" expression "]" -callActuals ::= "(" (expression ("," expression)* )? ")" -expression ::= exprStart (orExpr*) -orExpr ::= ("||" | "or") expression | andExpr -andExpr ::= ("&&" | "and") andExprRHS | neExpr -andExprRHS ::= exprStart (andExpr)* -neExpr ::= "!=" neExprRHS | eqExpr -neExprRHS ::= exprStart (neExpr)* -eqExpr ::= "==" eqExprRHS | gteExpr -eqExprRHS ::= exprStart (eqExpr)* -gteExpr ::= ">=" gteExprRHS | lteExpr -gteExprRHS ::= exprStart (gteExpr)* -lteExpr ::= "<=" lteExprRHS | gtExpr -lteExprRHS ::= exprStart (lteExpr)* -gtExpr ::= ">" gtExprRHS | ltExpr -gtExprRHS ::= exprStart (gtExpr)* -ltExpr ::= "<" ltExprRHS | plusExpr -ltExprRHS ::= exprStart (ltExpr)* -plusExpr ::= "+" plusExprRHS | minusExpr -plusExprRHS ::= exprStart (plusExpr)* -minusExpr ::= "-" minusExprRHS | modExpr -minusExprRHS ::= exprStart (minusExpr)* -modExpr ::= "%" modExprRHS | mulExpr -modExprRHS ::= exprStart (modExpr)* -mulExpr ::= "*" mulExprRHS | divExpr -mulExprRHS ::= exprStart (mulExpr)* -divExpr ::= "/" divExprRHS | accessExpr -divExprRHS ::= exprStart (divExpr)* -# whileStmt ::= "while" expression "{" body "}" -``` - -# Major Lexical elements - -Most of the lexical elements are inlined above, exxcept for the following: - -```ebnf -WS ::= (" " | "\t")+ ; Whitespace -NL ::= ("\r\n" | "\n") ; Newline -ID ::= IdStart|"$" (IdContinue|"$")* ; As defined by unicode standard -TRUE ::= "True" | "true" -FALSE ::= "False" | "false" -NULL ::= "Null" | "null" -NUM ::= ("0".."9")+ - ("." ("0".."9")+)? - (("e"|"E") ("+"|"-")? ("0".."9")+)? -STR ::= '"' ( ('\\' '"') | [^"\n] )* '"' -LINECOMMENT ::= ("#" | "//") [^\n]* -LONGCOMMENT ::= "/*" .* "*/" ; Minimal munch match. -``` - -# Notes - -1. Member access (i.e., dot notation) parses, but is not allowed. It will be added in, and at that point we will handle more complex assignments (i.e., arrays and dictionaries). -2. I removed the `while` operator, to ensure termination. I’ll probably add it back in as an option. -3. Though not yet in the grammar, I will be adding callbacks (basically non-recursive functions), so that the config file can process data that changes at runtime. -4. Similarly, I will be adding tuples to the language. -5. Strings actually are parsed for escape sequences, and handle both `\uxxxx` and `\Uxxxxxxxx` formats. However, we do not allow hex escapes, since input config files are always expected to be valid Unicode (generally UTF-8). diff --git a/docs/nim-api.md b/docs/nim-api.md deleted file mode 100644 index 1cd804aa..00000000 --- a/docs/nim-api.md +++ /dev/null @@ -1,23 +0,0 @@ -# Con4m Nim API - -## Coming soon - -For now, there’s auto-generated documentation linked below. I’m not a big fan of the current automatic documentation capabilities for Nim. Even though you only have to do: - -```bash -import con4m -``` - -To access everything, it generates pages for each module inside the package, even though you can’t really see those modules by default. What I really want is the exported API you get from importing the module should be united on one page. Maybe I’ll build some automation for that at some point. - -Until then, I do plan on writing a more in-depth developer intro, but for now, the autogen docs for the main interface, which should meet most needs, is pretty thorough. See the [documentation for `con4m()`](con4m/codegen.html). - -## Notes not in the auto-gen docs -- Con4m assumes that one thread only will compile the state, and that no other threads will attempt to use the config until it's loaded. -- Con4m currently does NOT support the same callback being called from multiple threads in parallel. If this might happen, you should put a lock around each callback. We may support this in the future; some of the work is done toward it. - -Or, the jumble of auto-gened docs are [available starting here](con4m.html). - -## More Info - -[Back to the home page.](https://github.com/crashappsec/con4m) diff --git a/docs/nimdoc.out.css b/docs/nimdoc.out.css deleted file mode 100644 index 4abea9ce..00000000 --- a/docs/nimdoc.out.css +++ /dev/null @@ -1,1016 +0,0 @@ -/* -Stylesheet for use with Docutils/rst2html. - -See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to -customize this style sheet. - -Modified from Chad Skeeters' rst2html-style -https://bitbucket.org/cskeeters/rst2html-style/ - -Modified by Boyd Greenfield and narimiran -*/ - -:root { - --primary-background: #fff; - --secondary-background: ghostwhite; - --third-background: #e8e8e8; - --info-background: #50c050; - --warning-background: #c0a000; - --error-background: #e04040; - --border: #dde; - --text: #222; - --anchor: #07b; - --anchor-focus: #607c9f; - --input-focus: #1fa0eb; - --strong: #3c3c3c; - --hint: #9A9A9A; - --nim-sprite-base64: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN4AAAA9CAYAAADCt9ebAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFFmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDggNzkuMTY0MDM2LCAyMDE5LzA4LzEzLTAxOjA2OjU3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6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iMcjshEqYR1Gdk1KmxBsaR9SQviSDdRFK8fxVU+YliWZmcbcq7vSFoQR/qJWvuxD0WgLDYoSzPzAqowtjVhORwDhEaKru4GPoliGgcyy4Hj0DLT4TBCo9WO88jQ8Bns97lLghvRTOfqqDiMYqrM+HyUYdBtaLykeRmlK12C9rQOh1FM1vd/HqUIzaT5e+LVoh/VxByHShs6HFaw0VjjHhTxP5d0LT+fRnu5q3HuAodlbHW02Q5cDByM+sw1642cRylCx6PeZiuTFScUFxK+f19QovaRS+t4tsasxhvABbZbSfUCV6CM7qtQl6Fm4E1U22UqcAYqvZ42fgJMxH6vdYc5nkBlSW6Pq4fbS6hb6jg0u9yGug7FyS5U1+UcVBbwbFSuMM1sQ1bXK4A9CcviqM0e9H80HdUxCpwIa4McygA/GfgAcCJqmGKKXUixupEv7nHsLc2agWNQ0d9OzC+PHNHIo1XeLCoe8kkqXiUtwKFoWXoEKqk3BpWLaC8cXsV8HT1J+tFTZKvn+DMqFZi1knvtyKg1O2lBHADcCVxEedNSAP4HJcsr0NNWHVUAAAAASUVORK5CYII="); - - --keyword: #5e8f60; - --identifier: #222; - --comment: #484a86; - --operator: #155da4; - --punctuation: black; - --other: black; - --escapeSequence: #c4891b; - --number: #252dbe; - --literal: #a4255b; - --program: #6060c0; - --option: #508000; - --raw-data: #a4255b; -} - -[data-theme="dark"] { - --primary-background: #171921; - --secondary-background: #1e202a; - --third-background: #2b2e3b; - --info-background: #008000; - --warning-background: #807000; - --error-background: #c03000; - --border: #0e1014; - --text: #fff; - --anchor: #8be9fd; - --anchor-focus: #8be9fd; - --input-focus: #8be9fd; - --strong: #bd93f9; - --hint: #7A7C85; - --nim-sprite-base64: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARMAAABMCAYAAABOBlMuAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFFmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWh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NiZTIRrMAlJAcHB18HBweWo6Mjy8rKajeJRAJLS0uwtLQECwsLoFAogMfjAYvFgpmZ2XNXMyqVCoaHh2FoaAiGh4cfvwYGBqCvrw+6u7vfvnfvXlNvb29rT09Pq0QsUM7S6c4rNqS/lrZ5U+YPRBKR9M7u9xwqBUUvtNAudH766XSLE8PR49ixE78/8tVnX403Zk7fUR46NUUAIPIPCMdTKJTdNjY2QKPRgE6nA51OB1tbWyCRSIDD4YBAIAAejwcCgfDYUajVakGlUoFarQadTvfY79HX1wf9/f0gl8tBLpfDvXv3HvXw+dxQPYYXMj+d+P7Mmzv+5OHr6/OJWq1GBHeB09TcUiKuq/coKS3/eqIx/wPkiIXC3w6YjAAAAABJRU5ErkJggg=="); - - --keyword: #ff79c6; - --identifier: #f8f8f2; - --comment: #6272a4; - --operator: #ff79c6; - --punctuation: #f8f8f2; - --other: #f8f8f2; - --escapeSequence: #bd93f9; - --number: #bd93f9; - --literal: #f1fa8c; - --program: #9090c0; - --option: #90b010; - --raw-data: #8be9fd; -} - -.theme-switch-wrapper { - display: flex; - align-items: center; -} - -.theme-switch-wrapper em { - margin-left: 10px; - font-size: 1rem; -} - -.theme-switch { - display: inline-block; - height: 22px; - position: relative; - width: 50px; -} - -.theme-switch input { - display: none; -} - -.slider { - background-color: #ccc; - bottom: 0; - cursor: pointer; - left: 0; - position: absolute; - right: 0; - top: 0; - transition: .4s; -} - -.slider:before { - background-color: #fff; - bottom: 4px; - content: ""; - height: 13px; - left: 4px; - position: absolute; - transition: .4s; - width: 13px; -} - -input:checked + .slider { - background-color: #66bb6a; -} - -input:checked + .slider:before { - transform: translateX(26px); -} - -.slider.round { - border-radius: 17px; -} - -.slider.round:before { - border-radius: 50%; -} - -html { - font-size: 100%; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; } - -body { - font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; - font-weight: 400; - font-size: 1.125em; - line-height: 1.5; - color: var(--text); - background-color: var(--primary-background); } - -/* Skeleton grid */ -.container { - position: relative; - width: 100%; - max-width: 1050px; - margin: 0 auto; - padding: 0; - box-sizing: border-box; } - -.column, -.columns { - width: 100%; - float: left; - box-sizing: border-box; - margin-left: 1%; -} - -.column:first-child, -.columns:first-child { - margin-left: 0; } - -.three.columns { - width: 22%; -} - -.nine.columns { - width: 77.0%; } - -.twelve.columns { - width: 100%; - margin-left: 0; } - -@media screen and (max-width: 860px) { - .three.columns { - display: none; - } - .nine.columns { - width: 98.0%; - } - body { - font-size: 1em; - line-height: 1.35; - } -} - -cite { - font-style: italic !important; } - - -/* Nim search input */ -div#searchInputDiv { - margin-bottom: 1em; -} -input#searchInput { - width: 80%; -} - -/* - * Some custom formatting for input forms. - * This also fixes input form colors on Firefox with a dark system theme on Linux. - */ -input { - -moz-appearance: none; - background-color: var(--secondary-background); - color: var(--text); - border: 1px solid var(--border); - font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; - font-size: 0.9em; - padding: 6px; -} - -input:focus { - border: 1px solid var(--input-focus); - box-shadow: 0 0 3px var(--input-focus); -} - -select { - -moz-appearance: none; - background-color: var(--secondary-background); - color: var(--text); - border: 1px solid var(--border); - font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; - font-size: 0.9em; - padding: 6px; -} - -select:focus { - border: 1px solid var(--input-focus); - box-shadow: 0 0 3px var(--input-focus); -} - -/* Docgen styles */ - -:target { - border: 2px solid #B5651D; - border-style: dotted; -} - -/* Links */ -a { - color: var(--anchor); - text-decoration: none; -} - -a span.Identifier { - text-decoration: underline; - text-decoration-color: #aab; -} - -a.reference-toplevel { - font-weight: bold; -} - -a.toc-backref { - text-decoration: none; - color: var(--text); } - -a.link-seesrc { - color: #607c9f; - font-size: 0.9em; - font-style: italic; } - -a:hover, -a:focus { - color: var(--anchor-focus); - text-decoration: underline; } - -a:hover span.Identifier { - color: var(--anchor); -} - - -sub, -sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; } - -sup { - top: -0.5em; } - -sub { - bottom: -0.25em; } - -img { - width: auto; - height: auto; - max-width: 100%; - vertical-align: middle; - border: 0; - -ms-interpolation-mode: bicubic; } - -@media print { - * { - color: black !important; - text-shadow: none !important; - background: transparent !important; - box-shadow: none !important; } - - a, - a:visited { - text-decoration: underline; } - - a[href]:after { - content: " (" attr(href) ")"; } - - abbr[title]:after { - content: " (" attr(title) ")"; } - - .ir a:after, - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; } - - pre, - blockquote { - border: 1px solid #999; - page-break-inside: avoid; } - - thead { - display: table-header-group; } - - tr, - img { - page-break-inside: avoid; } - - img { - max-width: 100% !important; } - - @page { - margin: 0.5cm; } - - h1 { - page-break-before: always; } - - h1.title { - page-break-before: avoid; } - - p, - h2, - h3 { - orphans: 3; - widows: 3; } - - h2, - h3 { - page-break-after: avoid; } -} - - -p { - margin-top: 0.5em; - margin-bottom: 0.5em; -} - -small { - font-size: 85%; } - -strong { - font-weight: 600; - font-size: 0.95em; - color: var(--strong); -} - -em { - font-style: italic; } - -h1 { - font-size: 1.8em; - font-weight: 400; - padding-bottom: .25em; - border-bottom: 6px solid var(--third-background); - margin-top: 2.5em; - margin-bottom: 1em; - line-height: 1.2em; } - -h1.title { - padding-bottom: 1em; - border-bottom: 0px; - font-size: 2.5em; - text-align: center; - font-weight: 900; - margin-top: 0.75em; - margin-bottom: 0em; -} - -h2 { - font-size: 1.3em; - margin-top: 2em; } - -h2.subtitle { - margin-top: 0em; - text-align: center; } - -h3 { - font-size: 1.125em; - font-style: italic; - margin-top: 1.5em; } - -h4 { - font-size: 1.125em; - margin-top: 1em; } - -h5 { - font-size: 1.125em; - margin-top: 0.75em; } - -h6 { - font-size: 1.1em; } - - -ul, -ol { - padding: 0; - margin-top: 0.5em; - margin-left: 0.75em; } - -ul ul, -ul ol, -ol ol, -ol ul { - margin-bottom: 0; - margin-left: 1.25em; } - -ul.simple > li { - list-style-type: circle; -} - -ul.simple-boot li { - list-style-type: none; - margin-left: 0em; - margin-bottom: 0.5em; -} - -ol.simple > li, ul.simple > li { - margin-bottom: 0.2em; - margin-left: 0.4em } - -ul.simple.simple-toc > li { - margin-top: 1em; -} - -ul.simple-toc { - list-style: none; - font-size: 0.9em; - margin-left: -0.3em; - margin-top: 1em; } - -ul.simple-toc > li { - list-style-type: none; -} - -ul.simple-toc-section { - list-style-type: circle; - margin-left: 0.8em; - color: #6c9aae; } - -ul.nested-toc-section { - list-style-type: circle; - margin-left: -0.75em; - color: var(--text); -} - -ul.nested-toc-section > li { - margin-left: 1.25em; -} - - -ol.arabic { - list-style: decimal; } - -ol.loweralpha { - list-style: lower-alpha; } - -ol.upperalpha { - list-style: upper-alpha; } - -ol.lowerroman { - list-style: lower-roman; } - -ol.upperroman { - list-style: upper-roman; } - -ul.auto-toc { - list-style-type: none; } - - -dl { - margin-bottom: 1.5em; } - -dt { - margin-bottom: -0.5em; - margin-left: 0.0em; } - -dd { - margin-left: 2.0em; - margin-bottom: 3.0em; - margin-top: 0.5em; } - - -hr { - margin: 2em 0; - border: 0; - border-top: 1px solid #aaa; } - -hr.footnote { - width: 25%; - border-top: 0.15em solid #999; - margin-bottom: 0.15em; - margin-top: 0.15em; -} -div.footnote-group { - margin-left: 1em; } -div.footnote-label { - display: inline-block; - min-width: 1.7em; -} - -div.option-list { - border: 0.1em solid var(--border); -} -div.option-list-item { - padding-left: 12em; - padding-right: 0; - padding-bottom: 0.3em; - padding-top: 0.3em; -} -div.odd { - background-color: var(--secondary-background); -} -div.option-list-label { - margin-left: -11.5em; - margin-right: 0em; - min-width: 11.5em; - display: inline-block; - vertical-align: top; -} -div.option-list-description { - width: calc(100% - 1em); - padding-left: 1em; - padding-right: 0; - display: inline-block; -} - -blockquote { - font-size: 0.9em; - font-style: italic; - padding-left: 0.5em; - margin-left: 0; - border-left: 5px solid #bbc; -} - -.pre, span.tok { - font-family: "Source Code Pro", Monaco, Menlo, Consolas, "Courier New", monospace; - font-weight: 500; - font-size: 0.85em; - color: var(--text); - background-color: var(--third-background); - padding-left: 3px; - padding-right: 3px; - border-radius: 4px; -} - -span.tok { - border: 1px solid #808080; - padding-bottom: 0.1em; - margin-right: 0.2em; -} - -pre { - font-family: "Source Code Pro", Monaco, Menlo, Consolas, "Courier New", monospace; - color: var(--text); - font-weight: 500; - display: inline-block; - box-sizing: border-box; - min-width: 100%; - padding: 0.5em; - margin-top: 0.5em; - margin-bottom: 0.5em; - font-size: 0.85em; - white-space: pre !important; - overflow-y: hidden; - overflow-x: visible; - background-color: var(--secondary-background); - border: 1px solid var(--border); - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; } - -.pre-scrollable { - max-height: 340px; - overflow-y: scroll; } - - -/* Nim line-numbered tables */ -.line-nums-table { - width: 100%; - table-layout: fixed; } - -table.line-nums-table { - border-radius: 4px; - border: 1px solid #cccccc; - background-color: ghostwhite; - border-collapse: separate; - margin-top: 15px; - margin-bottom: 25px; } - -.line-nums-table tbody { - border: none; } - -.line-nums-table td pre { - border: none; - background-color: transparent; } - -.line-nums-table td.blob-line-nums { - width: 28px; } - -.line-nums-table td.blob-line-nums pre { - color: #b0b0b0; - -webkit-filter: opacity(75%); - filter: opacity(75%); - text-align: right; - border-color: transparent; - background-color: transparent; - padding-left: 0px; - margin-left: 0px; - padding-right: 0px; - margin-right: 0px; } - - -table { - max-width: 100%; - background-color: transparent; - margin-top: 0.5em; - margin-bottom: 1.5em; - border-collapse: collapse; - border-color: var(--third-background); - border-spacing: 0; - font-size: 0.9em; -} - -table th, table td { - padding: 0px 0.5em 0px; - border-color: var(--third-background); -} - -table th { - background-color: var(--third-background); - border-color: var(--third-background); - font-weight: bold; } - -table th.docinfo-name { - background-color: transparent; - text-align: right; -} - -table tr:hover { - background-color: var(--third-background); } - - -/* rst2html default used to remove borders from tables and images */ -.borderless, table.borderless td, table.borderless th { - border: 0; } - -table.borderless td, table.borderless th { - /* Override padding for "table.docutils td" with "! important". - The right padding separates the table cells. */ - padding: 0 0.5em 0 0 !important; } - -.admonition { - padding: 0.3em; - background-color: var(--secondary-background); - border-left: 0.4em solid #7f7f84; - margin-bottom: 0.5em; - -webkit-box-shadow: 0 5px 8px -6px rgba(0,0,0,.2); - -moz-box-shadow: 0 5px 8px -6px rgba(0,0,0,.2); - box-shadow: 0 5px 8px -6px rgba(0,0,0,.2); -} -.admonition-info { - border-color: var(--info-background); -} -.admonition-info-text { - color: var(--info-background); -} -.admonition-warning { - border-color: var(--warning-background); -} -.admonition-warning-text { - color: var(--warning-background); -} -.admonition-error { - border-color: var(--error-background); -} -.admonition-error-text { - color: var(--error-background); -} - -.first { - /* Override more specific margin styles with "! important". */ - margin-top: 0 !important; } - -.last, .with-subtitle { - margin-bottom: 0 !important; } - -.hidden { - display: none; } - -blockquote.epigraph { - margin: 2em 5em; } - -dl.docutils dd { - margin-bottom: 0.5em; } - -object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { - overflow: hidden; } - - -div.figure { - margin-left: 2em; - margin-right: 2em; } - -div.footer, div.header { - clear: both; - text-align: center; - color: #666; - font-size: smaller; } - -div.footer { - padding-top: 5em; -} - -div.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; } - -div.line-block div.line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; } - -div.topic { - margin: 2em; } - -div.search_results { - background-color: var(--third-background); - margin: 3em; - padding: 1em; - border: 1px solid #4d4d4d; -} - -div#global-links ul { - margin-left: 0; - list-style-type: none; -} - -div#global-links > simple-boot { - margin-left: 3em; -} - -hr.docutils { - width: 75%; } - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; } - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; } - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; } - -.align-left { - text-align: left; } - -.align-center { - clear: both; - text-align: center; } - -.align-right { - text-align: right; } - -/* reset inner alignment in figures */ -div.align-right { - text-align: inherit; } - -p.attribution { - text-align: right; - margin-left: 50%; } - -p.caption { - font-style: italic; } - -p.credits { - font-style: italic; - font-size: smaller; } - -p.label { - white-space: nowrap; } - -p.rubric { - font-weight: bold; - font-size: larger; - color: maroon; - text-align: center; } - -p.topic-title { - font-weight: bold; } - -pre.address { - margin-bottom: 0; - margin-top: 0; - font: inherit; } - -pre.literal-block, pre.doctest-block, pre.math, pre.code { - margin-left: 2em; - margin-right: 2em; } - -pre.code .ln { - color: grey; } - -/* line numbers */ -pre.code, code { - background-color: #eeeeee; } - -pre.code .comment, code .comment { - color: #5c6576; } - -pre.code .keyword, code .keyword { - color: #3B0D06; - font-weight: bold; } - -pre.code .literal.string, code .literal.string { - color: #0c5404; } - -pre.code .name.builtin, code .name.builtin { - color: #352b84; } - -pre.code .deleted, code .deleted { - background-color: #DEB0A1; } - -pre.code .inserted, code .inserted { - background-color: #A3D289; } - -span.classifier { - font-style: oblique; } - -span.classifier-delimiter { - font-weight: bold; } - -span.problematic { - color: #b30000; } - -span.section-subtitle { - /* font-size relative to parent (h1..h6 element) */ - font-size: 80%; } - -span.DecNumber { - color: var(--number); } - -span.BinNumber { - color: var(--number); } - -span.HexNumber { - color: var(--number); } - -span.OctNumber { - color: var(--number); } - -span.FloatNumber { - color: var(--number); } - -span.Identifier { - color: var(--identifier); } - -span.Keyword { - font-weight: 600; - color: var(--keyword); } - -span.StringLit { - color: var(--literal); } - -span.LongStringLit { - color: var(--literal); } - -span.CharLit { - color: var(--literal); } - -span.EscapeSequence { - color: var(--escapeSequence); } - -span.Operator { - color: var(--operator); } - -span.Punctuation { - color: var(--punctuation); } - -span.Comment, span.LongComment { - font-style: italic; - font-weight: 400; - color: var(--comment); } - -span.RegularExpression { - color: darkviolet; } - -span.TagStart { - color: darkviolet; } - -span.TagEnd { - color: darkviolet; } - -span.Key { - color: #252dbe; } - -span.Value { - color: #252dbe; } - -span.RawData { - color: var(--raw-data); } - -span.Assembler { - color: #252dbe; } - -span.Preprocessor { - color: #252dbe; } - -span.Directive { - color: #252dbe; } - -span.option { - font-weight: bold; - font-family: "Source Code Pro", Monaco, Menlo, Consolas, "Courier New", monospace; - color: var(--option); -} - -span.Prompt { - font-weight: bold; - color: red; } - -span.ProgramOutput { - font-weight: bold; - color: #808080; } - -span.program { - font-weight: bold; - color: var(--program); - text-decoration: underline; - text-decoration-color: var(--hint); - text-decoration-thickness: 0.05em; - text-underline-offset: 0.15em; -} - -span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference, -span.Other { - color: var(--other); } - -/* Pop type, const, proc, and iterator defs in nim def blocks */ -dt pre > span.Identifier, dt pre > span.Operator { - color: var(--identifier); - font-weight: 700; } - -dt pre > span.Keyword ~ span.Identifier, dt pre > span.Identifier ~ span.Identifier, -dt pre > span.Operator ~ span.Identifier, dt pre > span.Other ~ span.Identifier { - color: var(--identifier); - font-weight: inherit; } - -/* Nim sprite for the footer (taken from main page favicon) */ -.nim-sprite { - display: inline-block; - width: 51px; - height: 14px; - background-position: 0 0; - background-size: 51px 14px; - -webkit-filter: opacity(50%); - filter: opacity(50%); - background-repeat: no-repeat; - background-image: var(--nim-sprite-base64); - margin-bottom: 5px; } - -span.pragmadots { - /* Position: relative frees us up to make the dots - look really nice without fucking up the layout and - causing bulging in the parent container */ - position: relative; - /* 1px down looks slightly nicer */ - top: 1px; - padding: 2px; - background-color: var(--third-background); - border-radius: 4px; - margin: 0 2px; - cursor: pointer; - font-size: 0.8em; -} - -span.pragmadots:hover { - background-color: var(--hint); -} -span.pragmawrap { - display: none; -} - -span.attachedType { - display: none; - visibility: hidden; -} diff --git a/docs/theindex.html b/docs/theindex.html deleted file mode 100644 index 71963c79..00000000 --- a/docs/theindex.html +++ /dev/null @@ -1,1448 +0,0 @@ - - - - - - - - - - - - - - - - - - -Index - - - - - - - - -
-
-

Index

- Modules: con4m/box, con4m/builtins, con4m/codegen, con4m/con4m_types, con4m/dollars, con4m/eval, con4m/lex, con4m/parse, con4m/spec, con4m/st, con4m/treecheck, con4m/typecheck, con4m/types, con4m/unicodeident.

API symbols

-
`$`:
-
addAttr:
-
addDefaultBuiltins:
-
addEntry:
-
addGlobalAttr:
-
addSection:
-
addSpec:
-
AttrSpec:
-
boolType:
-
bottomType:
-
box:
-
Box:
-
boxDict:
-
boxList:
-
builtInAbort:
-
builtinBToS:
-
builtinCmd:
-
builtinContainsStrStr:
-
builtInDictKeys:
-
builtInDictLen:
-
builtinDToB:
-
builtinEcho:
-
builtinEnv:
-
builtinEnvAll:
-
builtinEnvExists:
-
builtinFindFromStart:
-
BuiltInFn:
-
builtInFormat:
-
builtinFtoB:
-
builtinFToI:
-
builtinFToS:
-
BuiltInInfo:
-
builtinItoB:
-
builtinIToF:
-
builtinIToS:
-
builtInListLen:
-
builtinLToB:
-
builtInPad:
-
builtinSlice:
-
builtinSliceToEnd:
-
builtinSplit:
-
builtinStoB:
-
builtinStrip:
-
builtInStrLen:
-
builtinSystem:
-
checkTree:
-
con4m:
-
Con4mDict:
-
Con4mError:
-
Con4mNode:
-
Con4mNodeKind:
-
Con4mScope:
-
Con4mSectInfo:
-
Con4mToken:
-
Con4mTokenKind:
-
Con4mType:
-
Con4mTypeKind:
-
configDef:
-
ConfigSpec:
-
ConfigState:
-
copyType:
-
CurScopes:
-
dottedLookup:
-
ErrorLongComment:
-
ErrorStringLit:
-
ErrorTok:
-
evalConfig:
-
evalNode:
-
evalTree:
-
fatal:
-
FieldAttrs:
-
FieldValidator:
-
floatType:
-
FnBuiltIn:
-
FnCallback:
-
FnType:
-
FnUserDefined:
-
FuncTableEntry:
-
getAllSectionSTs:
-
getAttrScope:
-
getBaseType:
-
getBothScopes:
-
getConfigVar:
-
getEntry:
-
getTokenText:
-
getVarScope:
-
hasTypeVar:
-
intType:
-
isBottom:
-
isIdContinue:
-
isIdStart:
-
isOtherIdContinue:
-
isOtherIdStart:
-
isPatternSyntax:
-
isPatternWhiteSpace:
-
isValidId:
-
lex:
-
lockConfigVar:
-
lookup:
-
lookupAttr:
-
newBuiltIn:
-
newCallback:
-
newCon4mDict:
-
newConfigSpec:
-
newConfigState:
-
newDictType:
-
newListType:
-
newProcType:
-
newRootScope:
-
newTypeVar:
-
NodeActuals:
-
NodeAnd:
-
NodeAttrAssign:
-
NodeBody:
-
NodeBreak:
-
NodeCall:
-
NodeCmp:
-
NodeConditional:
-
NodeContinue:
-
NodeDictLit:
-
NodeDiv:
-
NodeElse:
-
NodeEnum:
-
NodeFor:
-
NodeFormalList:
-
NodeFuncDef:
-
NodeGt:
-
NodeGte:
-
NodeIdentifier:
-
NodeIfStmt:
-
NodeIndex:
-
NodeKVPair:
-
NodeListLit:
-
NodeLt:
-
NodeLte:
-
NodeMember:
-
NodeMinus:
-
NodeMod:
-
NodeMul:
-
NodeNe:
-
NodeNot:
-
NodeOr:
-
NodePlus:
-
NodeReturn:
-
NodeSection:
-
NodeSimpLit:
-
NodeTupleLit:
-
NodeUnary:
-
NodeUnpack:
-
NodeVarAssign:
-
parse:
-
peekRune:
-
readRune:
-
reprSig:
-
runCallback:
-
RuntimeFrame:
-
runtimeVarLookup:
-
runtimeVarSet:
-
sCall:
-
scopeToJson:
-
SectionSpec:
-
SectionState:
-
setOverride:
-
stackConfig:
-
STEntry:
-
stringType:
-
toCon4mType:
-
TtAnd:
-
TtAttrAssign:
-
TtBreak:
-
TtCallback:
-
TtCmp:
-
TtColon:
-
TtComma:
-
TtContinue:
-
TtDiv:
-
TTElIf:
-
TTElse:
-
TtEnum:
-
TtEof:
-
TtFalse:
-
TtFloatLit:
-
TtFor:
-
TtFrom:
-
TtFunc:
-
TtGt:
-
TtGte:
-
TtIdentifier:
-
TTIf:
-
TtIntLit:
-
TtLBrace:
-
TtLBracket:
-
TtLineComment:
-
TtLocalAssign:
-
TtLongComment:
-
TtLParen:
-
TtLt:
-
TtLte:
-
TtMinus:
-
TTMod:
-
TtMul:
-
TtNeq:
-
TtNewLine:
-
TtNot:
-
TtNull:
-
TtOr:
-
TtPeriod:
-
TtPlus:
-
TtRBrace:
-
TtRBracket:
-
TtReturn:
-
TtRParen:
-
TtSemi:
-
TtSof:
-
TtStringLit:
-
TtTo:
-
TtTrue:
-
TtWhiteSpace:
-
TypeBool:
-
TypeBottom:
-
TypeDict:
-
TypeFloat:
-
TypeInt:
-
TypeList:
-
TypeProc:
-
TypeString:
-
TypeTuple:
-
TypeTVar:
-
unbox:
-
unboxDict:
-
unboxList:
-
unify:
-
unreachable:
-
validateConfig:
-
VarStack:
-
-
- -
-
-
- - - diff --git a/docs/writing.md b/docs/writing.md deleted file mode 100644 index 860b2944..00000000 --- a/docs/writing.md +++ /dev/null @@ -1,193 +0,0 @@ -# Writing config files with Con4m - -Con4m is meant to be familiar to anyone who has ever messed with a configuration file. But, it also makes it easy to make configuration decisions at the time the program runs (and at some point, dynamically if desired). - -You can set global configuration values, and add named sections that can be tagged, and have attributes. For instance: - -```bash -git_user: "john@crashoverride.com" -repository con4m { - URI: "https://www.github.com/crashappsec/con4m.git" - key_file: "~/.ssh/con4mKey" -} -repository sami { - URI: "https://www.github.com/crashappsec/sami.git" - key_file: "~/.ssh/samiKey" -} -``` - -In Con4m, attribute names are standard unicode identifiers. The right hand side of an attribute is *not* free-form. Strings need to be put in quotes (and they do accept unicode escape sequences, etc). - -The section name (here, just repository), is followed by zero or more tags. But this might depend on the context— most uses of Con4m will enforce a config file schema. - -# Builtin function calls - -One feature of Con4m is that can make function calls, for instance to run other shell commands, or output text: - -```bash -text := run("ls -l") -echo(text) -``` - -This will output (on my machine): - -```bash -total 712 -drwx------@ 3 viega staff 96 Oct 29 20:02 Applications -drwx------+ 8 viega staff 256 Dec 5 18:48 Desktop -drwx------+ 21 viega staff 672 Nov 7 14:56 Documents -drwx------@ 537 viega staff 17184 Dec 6 20:55 Downloads -... -``` - -Con4m provides several built-in calls, and will be adding more ([see the current list here](builtins.md)). Individual applications can add or remove them easily, though, so it’s good to check the documentation for any particular application. - -You can also write and call your own functions in the config file, which is discussed below. - -One particularly useful call is `env()`. It gives you the ability to override configuration decisions encoded in the file, without changing the file. But, the program doesn’t have to add support for environment variables you have to hunt around to find… you get to create the environment variables you need, and name them what you like, thanks to the `if` statement: - -# If statement - -```bash -default_compiler_flags: "-O2" -if env("CON4M_DEBUG") { - default_compiler_flags: "-DDEBUG -O0" # replaces the other assignment -} -elif env("CON4M_ADD_FPIC"): - # Note that format({}) implements Python-like formatters with the - # local environment. Selective access to runtime formatting is a - # roadmap item. - default_compiler_flags: format("{default_compiler_flags} -fPIC") -} -``` - -The Con4m if statement supports arbitrary elif branches, and a final else branch. Obviously, different branches may end up not setting the same attributes. Thats okay… the application gets to decide if a configuration is valid or not, and usually many options will have default values, or be truly optional. - -It’s important to know that loop conditions need to evaluate to either `true` or `false`. You can use `or` and `and` (`||` and `&&` also work) as well, but again, each side must evaluate to true or false. Any other data type can be converted to true or false with a [builtin conversion call](builtins.md). This requirement might be annoying to people who aren’t used to it, but results in more robust code in our experience. - -# Attributes vs. Variables - -You might have noticed, in the first example, we set config file keys with a colon. And, we could also have used an equals sign. People just slapping together simple config files shouldn’t have to work too hard on syntax to get it right, and both are familiar, so both should work. - -However, as mentioned above, one of the advantages of Con4m from an application writer’s point of view is that they can write a simple schema that will still sanity check the application, making sure that the right attributes are present, and no more. They need to be able to make sure that the config file writer does not pollute the namespace with junk! - -But, if you’re doing any sort of transformation to set attributes, you will probably want helper variables that do NOT get presented as part of the program’s configuration attributes. For that, we use the so-called *"tusk"* operator, used in languages like go. We did actually see this above: - -```bash -text := run("ls -l") -``` - -This command will create a variable called `text` that’s available in the execution environment, but is not used by the program you’re configuring. And, when we add runtime callbacks into the language (so that you can configure based on dynamic runtime information), the default will be that the variable state will still be available. - -# For loops - -Con4m currently doesn’t allow indefinite loops, but `for` loops work, and so do `break` and `continue`: - -```bash -path := env("PATH") -desired := "~" -found = false -parts := split(path, ":") -for i from 0 to len(parts) { - if parts[i] == "" { - continue - } - elif parts[i] == desired { - break - } - echo ("Not what I'm looking for: ", parts[i]) -} -if found { - echo("Found it!") -} -``` - -Some things to note here: - -1. If we hadn’t set the variable `found` before the start of the loop, this code could throw a runtime error; the language is not doing the static analysis to detect such conditions, so these would show up when evaluating the configuration file. -2. We currently only support `for i from n to m` syntax. The numbers can go up or down, but we don’t support steps, or iterating explicitly over arrays or dictionaries. This will probably change. -3. The user is not allowed to modify the value of the index variable themselves. It must be an identifier (not a complex expression), and it can only be incremented by the system, helping to prevent infinite loops. -4. The desire to ensure termination is why there currently isn’t a `while` loop. We will probably add it at some point, but in conjunction with a ceiling on overall config file execution time. -5. The `end` value in the range is evaluated BEFORE the loop body runs, not on every iteration. - -# Data types and typing - -Con4m has lists and dictionaries, with syntax like you’d expect: - -```bash -my_path = ["/home/viega/bin", "/usr/sbin", "/usr/bin", "."] -user_priorities = { "john@crashoverride.com" : 5, - "mark@crashoverride.com" : 1, - "theo@crashoverride.com" : 10 - } -``` - -You can access items with square brackets: - -```bash -for i from 0 to len(my_path) { - echo(my_path[i]) -} - -echo user_priorities["john@crashoverride.com"] -``` - -However, there is not currently a syntax for setting individual fields in dicts or lists, as you can not yet — we will add this soon via builtin calls, and eventually will improve assignment so that you can have array and member access on the left hand side of the assignment. - -Note that list items must all have the same type. Similarly, dictionary keys must always have the same type, as much dictionary values. Additionally, dictionary keys are currently limited to only strings and integers. - -Con4m does significant static type checking. Once an attribute or variable is assigned a type, any inconsistencies will result in a compile-time (config load time) error. All types are currently inferred from the context -- you do not have to declare types. - -Of course, you can set individual attributes to any type you want. They just cannot change. And, most uses of Con4m will specify a schema, meaning that after your config finishes loading, it will be generally checked against the specified types, and any incompatibility will again produce an error (though the application could choose to ignore it). - -Con4m also has tuple types. For instance, the built in `system()` function acts like `run()`, except that it returns a tuple, the first value containing the output of the command, the second tuple containing the exit value: - -```bash -output, exitval = system("mycommand -x") - -if exitval != 0 { - echo("That didn't work :(") -} else { - echo(output) -} -``` - -# Functions and callbacks - -Con4m does support user-defined functions. You can create and call a function just for your internal use, using the `func` keyword, or for the program to call back into at runtime with the `callback` keyword. - -All the code in your config file NOT in a callback will run when the config file loads. Callbacks run after, whenever the program decides it needs to call it. To that end, you can only define callbacks with name and parameters that are actually used by the application. - -Functions, though, you can call yourself. For instance: - -``` -func fact(f) { - result := 1 - for i from 1 to f { - result := result * i - } -} - -for i from 1 to 10 { - x := fact(i) - echo (format("fact({i}) = {x}")) -} -``` - -Some things to note about functions: -- You CANNOT use global variables inside functions or callbacks. They will not be available. Pass them in as parameters. This is because we reset global variable state if a config file gets reloaded, or if a second config file gets 'stacked' on top of this one. Particularly for stacked configuration files, it would be too much of a surprise for globals to persist (whereas attributes would be expected to persist). -- Currently, you can only access GLOBAL attributes from within functions, because we have not yet implemented the dot operator for member access. This will change. -- You CAN call `func`s from your callbacks; they will run at the time of the callback. -- You never declare types for function parameters. The system is capable of figuring out all required type information statically. -- You do not need to worry about calling a function in a place in the file before you define it. If needed, the compiler will make a second pass. -- Currently, users can NOT declare varargs functions. We may choose to add this, but do not right now. -- We do not support default arguments. -- Recursive functions are available by default, but they can be turned off at the time the program using con4m is compiled. -- If you use an enum (which defines immutable constants), they generally live in the scope of VARIABLES. They go away if a new config file gets loaded on top of yours, so they should not be used if called from callbacks. However, we do explicitly make them available for local functions. If a callback tries to use one when a new config has been layered in, you could end up with significant issues. I am thinking about removing enums, or else giving them their own permanant status without making them an attribute. Haven't decided which is best yet, so they're currently living in this in-between state. - -# Learn more! - -- Browse the current list of [builtin function calls](builtins.md). -- View the [syntax reference](langref.md). -- [Check out the developer API](nim-api.md). -- [Go back to the home page.](https://github.com/crashappsec/con4m) diff --git a/files/con4m/builtins.nim b/files/con4m/builtins.nim index ec19972a..2637eb41 100644 --- a/files/con4m/builtins.nim +++ b/files/con4m/builtins.nim @@ -6,7 +6,7 @@ ## :Copyright: 2022 - 2023 import os, tables, osproc, strformat, strutils, options, streams, base64, - macros, nimSHA2, types, typecheck, st, parse, nimutils, errmsg, + macros, types, typecheck, st, parse, nimutils, errmsg, otherlits, treecheck, dollars, unicode, json, httpclient, net, uri, openssl, sugar, nimutils/managedtmp @@ -704,14 +704,10 @@ proc c4mFromHex*(args: seq[Box], unused = ConfigState(nil)): Option[Box] = raise c4mException(getCurrentExceptionMsg()) proc c4mSha256*(args: seq[Box], unused = ConfigState(nil)): Option[Box] = - var shaCtx = initSHA[SHA256]() - shaCtx.update(unpack[string](args[0])) - return some(pack(shaCtx.final().toHex().toLowerAscii())) + return some(pack(sha256Hex(unpack[string](args[0])))) proc c4mSha512*(args: seq[Box], unused = ConfigState(nil)): Option[Box] = - var shaCtx = initSHA[SHA512]() - shaCtx.update(unpack[string](args[0])) - return some(pack(shaCtx.final().toHex().toLowerAscii())) + return some(pack(sha512Hex(unpack[string](args[0])))) proc c4mUpper*(args: seq[Box], unused = ConfigState(nil)): Option[Box] = return some(pack(unicode.toUpper(unpack[string](args[0])))) @@ -1254,7 +1250,7 @@ proc c4mUrlGet*(args: seq[Box], unused = ConfigState(nil)): Option[Box] = let url = unpack[string](args[0]) res = url.c4mUrlBase(post = false, body = "", headers = nil, - pinnedCert = "", timeout = 5) + pinnedCert = "", timeout = 5000) result = some(pack(res)) @@ -1263,7 +1259,7 @@ proc c4mUrlGetPinned*(args: seq[Box], unused = ConfigState(nil)): Option[Box] = url = unpack[string](args[0]) cert = unpack[string](args[1]) res = url.c4mUrlBase(post = false, body = "", headers = nil, - pinnedCert = cert, timeout = 5) + pinnedCert = cert, timeout = 5000) result = some(pack(res)) @@ -1272,7 +1268,8 @@ proc c4mUrlPost*(args: seq[Box], unused = ConfigState(nil)): Option[Box] = url = unpack[string](args[0]) body = unpack[string](args[1]) headers = unpack[OrderedTableRef[string, string]](args[2]) - res = url.c4mUrlBase(true, body, headers, pinnedCert = "", timeout = 5) + res = url.c4mUrlBase(true, body, headers, pinnedCert = "", + timeout = 5000) result = some(pack(res))