New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

walt-syntax

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

walt-syntax - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

package.json
{
"name": "walt-syntax",
"version": "0.1.1",
"version": "0.1.2",
"description": "Walt Syntax",

@@ -5,0 +5,0 @@ "main": "dist/walt-syntax.js",

@@ -55,1 +55,54 @@ # Walt Syntax

## Abstract Syntax Tree
Syntax nodes are Plain Old JavaScript Objects.
```
export type NodeType = {
range: Marker[],
Type: string,
type: string | null,
value: string,
meta: { [string]: any },
params: NodeType[],
};
```
`Type` is a pre-defined walt-specific string constant. For a full list of these constants, refer to the source. `type`(lowercase) is the WebAssembly type and must be one of `i32 | f32 | i64 | f64` or the literal `null` value which represents a void value. Note: Any valid string _could_ be the `type` value but only the 5 supported values above will _compile_.
`params` are the children of the node.
`meta` is used to hold information about the node which is not present in the source program and is either inferred or implied. For example a struct type definition may contain the key value offsets which are used to compile it's property look ups.
## Compile-able AST Types
While many different nodes are possible a strict subset of node `Type` are considered valid by the generator and are compile-able.
```
Syntax.Typedef,
Syntax.Import,
Syntax.Export,
Syntax.FunctionDeclaration,
Syntax.FunctionCall,
Syntax.IndirectFunctionCall,
Syntax.Constant,
Syntax.BinaryExpression,
Syntax.TernaryExpression,
Syntax.IfThenElse,
Syntax.Else,
Syntax.Select,
Syntax.Block,
Syntax.Identifier,
Syntax.FunctionIdentifier,
Syntax.FunctionPointer,
Syntax.ReturnStatement,
Syntax.Declaration,
Syntax.ArraySubscript,
Syntax.Assignment,
Syntax.MemoryAssignment,
Syntax.Loop,
Syntax.Break,
Syntax.Sequence,
Syntax.TypeCast,
Syntax.Noop,
Syntax.NativeMethod
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc