@robinpath/robinpath 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +856 -0
- package/bin/robinpath.js +374 -0
- package/dist/classes/ASTSerializer.d.ts +45 -0
- package/dist/classes/ExecutionStateTracker.d.ts +30 -0
- package/dist/classes/Executor.d.ts +193 -0
- package/dist/classes/ExpressionEvaluator.d.ts +20 -0
- package/dist/classes/Lexer.d.ts +86 -0
- package/dist/classes/Parser.d.ts +71 -0
- package/dist/classes/RobinPathThread.d.ts +146 -0
- package/dist/classes/TokenStream.d.ts +217 -0
- package/dist/classes/code-converter/ASTToCodeConverter.d.ts +178 -0
- package/dist/classes/code-converter/LineIndex.d.ts +54 -0
- package/dist/classes/code-converter/Printer.d.ts +117 -0
- package/dist/classes/code-converter/Writer.d.ts +42 -0
- package/dist/classes/code-converter/index.d.ts +8 -0
- package/dist/classes/code-converter/types.d.ts +29 -0
- package/dist/classes/exceptions.d.ts +26 -0
- package/dist/classes/index.d.ts +16 -0
- package/dist/index.d.ts +485 -0
- package/dist/index.js +13808 -0
- package/dist/modules/Array.d.ts +10 -0
- package/dist/modules/Core.d.ts +10 -0
- package/dist/modules/Dom.d.ts +10 -0
- package/dist/modules/Fetch.d.ts +6 -0
- package/dist/modules/Json.d.ts +10 -0
- package/dist/modules/Math.d.ts +10 -0
- package/dist/modules/Object.d.ts +10 -0
- package/dist/modules/Random.d.ts +6 -0
- package/dist/modules/String.d.ts +10 -0
- package/dist/modules/Test.d.ts +10 -0
- package/dist/modules/Time.d.ts +10 -0
- package/dist/parsers/ArrayLiteralParser.d.ts +17 -0
- package/dist/parsers/AssignmentParser.d.ts +37 -0
- package/dist/parsers/BracketParser.d.ts +31 -0
- package/dist/parsers/BreakParser.d.ts +15 -0
- package/dist/parsers/CellBlockParser.d.ts +11 -0
- package/dist/parsers/ChunkMarkerParser.d.ts +12 -0
- package/dist/parsers/CommandParser.d.ts +56 -0
- package/dist/parsers/CommentParser.d.ts +37 -0
- package/dist/parsers/ContinueParser.d.ts +15 -0
- package/dist/parsers/DecoratorParser.d.ts +29 -0
- package/dist/parsers/DefineParser.d.ts +18 -0
- package/dist/parsers/EventParser.d.ts +17 -0
- package/dist/parsers/ExpressionParser.d.ts +3 -0
- package/dist/parsers/FenceClassifier.d.ts +29 -0
- package/dist/parsers/ForLoopParser.d.ts +17 -0
- package/dist/parsers/IfBlockParser.d.ts +17 -0
- package/dist/parsers/ObjectLiteralParser.d.ts +17 -0
- package/dist/parsers/ParserUtils.d.ts +15 -0
- package/dist/parsers/PromptBlockParser.d.ts +10 -0
- package/dist/parsers/ReturnParser.d.ts +16 -0
- package/dist/parsers/ScopeParser.d.ts +24 -0
- package/dist/parsers/StringTemplateParser.d.ts +31 -0
- package/dist/parsers/SubexpressionParser.d.ts +33 -0
- package/dist/parsers/TogetherBlockParser.d.ts +18 -0
- package/dist/parsers/WithScopeParser.d.ts +24 -0
- package/dist/types/Ast.type.d.ts +455 -0
- package/dist/types/Environment.type.d.ts +53 -0
- package/dist/utils/args.d.ts +24 -0
- package/dist/utils/errorFormatter.d.ts +22 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/stringParsing.d.ts +41 -0
- package/dist/utils/types.d.ts +15 -0
- package/dist/utils/valueConversion.d.ts +25 -0
- package/package.json +50 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Value } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert a Value to its JavaScript string representation
|
|
4
|
+
*/
|
|
5
|
+
export declare function valueToJS(val: Value): string;
|
|
6
|
+
/**
|
|
7
|
+
* Evaluate a JavaScript expression string
|
|
8
|
+
* Simple expression evaluator - in production you'd want a proper parser
|
|
9
|
+
*/
|
|
10
|
+
export declare function evalExpression(expr: string): any;
|
|
11
|
+
/**
|
|
12
|
+
* Check if a value is truthy according to RobinPath rules
|
|
13
|
+
*/
|
|
14
|
+
export declare function isTruthy(val: Value): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Get the type of a value
|
|
17
|
+
*/
|
|
18
|
+
export declare function getValueType(value: Value): 'string' | 'number' | 'boolean' | 'null' | 'object' | 'array';
|
|
19
|
+
/**
|
|
20
|
+
* Attempt to convert a value to a different type
|
|
21
|
+
* @param value The value to convert
|
|
22
|
+
* @param targetType The target type to convert to
|
|
23
|
+
* @returns The converted value, or null if conversion fails
|
|
24
|
+
*/
|
|
25
|
+
export declare function convertValueType(value: Value, targetType: 'string' | 'number' | 'boolean' | 'null' | 'object' | 'array'): Value | null;
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@robinpath/robinpath",
|
|
3
|
+
"description": "RobinPath - A lightweight, fast, and easy-to-use scripting language for automation and data processing.",
|
|
4
|
+
"version": "0.30.0",
|
|
5
|
+
"author": "Ryan Lee <ryan@wiredwp.com>",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite",
|
|
20
|
+
"build": "vite build",
|
|
21
|
+
"preview": "vite preview",
|
|
22
|
+
"push": "npm run build && npm publish --access public",
|
|
23
|
+
"test": "npm run build && node test/run.js",
|
|
24
|
+
"test:coverage": "npm run build && c8 node test/run.js",
|
|
25
|
+
"test:coverage:report": "c8 report --reporter=html --reporter=text",
|
|
26
|
+
"test:watch": "nodemon --watch src --watch test --ext ts,js,robin --exec 'npm run test'",
|
|
27
|
+
"test-perform": "npm run build && node test/run-performance.js",
|
|
28
|
+
"test-code": "npm run build && node test/test-code.js",
|
|
29
|
+
"cli": "npm run build && node bin/robinpath.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"bin",
|
|
34
|
+
"README.md",
|
|
35
|
+
"package.json"
|
|
36
|
+
],
|
|
37
|
+
"bin": {
|
|
38
|
+
"robinpath": "./bin/robinpath.js"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"c8": "^10.1.3",
|
|
42
|
+
"nodemon": "^3.1.9",
|
|
43
|
+
"typescript": "~5.9.3",
|
|
44
|
+
"vite": "^7.2.4",
|
|
45
|
+
"vite-plugin-dts": "^4.0.0"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"json5": "^2.2.3"
|
|
49
|
+
}
|
|
50
|
+
}
|