@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.
Files changed (65) hide show
  1. package/README.md +856 -0
  2. package/bin/robinpath.js +374 -0
  3. package/dist/classes/ASTSerializer.d.ts +45 -0
  4. package/dist/classes/ExecutionStateTracker.d.ts +30 -0
  5. package/dist/classes/Executor.d.ts +193 -0
  6. package/dist/classes/ExpressionEvaluator.d.ts +20 -0
  7. package/dist/classes/Lexer.d.ts +86 -0
  8. package/dist/classes/Parser.d.ts +71 -0
  9. package/dist/classes/RobinPathThread.d.ts +146 -0
  10. package/dist/classes/TokenStream.d.ts +217 -0
  11. package/dist/classes/code-converter/ASTToCodeConverter.d.ts +178 -0
  12. package/dist/classes/code-converter/LineIndex.d.ts +54 -0
  13. package/dist/classes/code-converter/Printer.d.ts +117 -0
  14. package/dist/classes/code-converter/Writer.d.ts +42 -0
  15. package/dist/classes/code-converter/index.d.ts +8 -0
  16. package/dist/classes/code-converter/types.d.ts +29 -0
  17. package/dist/classes/exceptions.d.ts +26 -0
  18. package/dist/classes/index.d.ts +16 -0
  19. package/dist/index.d.ts +485 -0
  20. package/dist/index.js +13808 -0
  21. package/dist/modules/Array.d.ts +10 -0
  22. package/dist/modules/Core.d.ts +10 -0
  23. package/dist/modules/Dom.d.ts +10 -0
  24. package/dist/modules/Fetch.d.ts +6 -0
  25. package/dist/modules/Json.d.ts +10 -0
  26. package/dist/modules/Math.d.ts +10 -0
  27. package/dist/modules/Object.d.ts +10 -0
  28. package/dist/modules/Random.d.ts +6 -0
  29. package/dist/modules/String.d.ts +10 -0
  30. package/dist/modules/Test.d.ts +10 -0
  31. package/dist/modules/Time.d.ts +10 -0
  32. package/dist/parsers/ArrayLiteralParser.d.ts +17 -0
  33. package/dist/parsers/AssignmentParser.d.ts +37 -0
  34. package/dist/parsers/BracketParser.d.ts +31 -0
  35. package/dist/parsers/BreakParser.d.ts +15 -0
  36. package/dist/parsers/CellBlockParser.d.ts +11 -0
  37. package/dist/parsers/ChunkMarkerParser.d.ts +12 -0
  38. package/dist/parsers/CommandParser.d.ts +56 -0
  39. package/dist/parsers/CommentParser.d.ts +37 -0
  40. package/dist/parsers/ContinueParser.d.ts +15 -0
  41. package/dist/parsers/DecoratorParser.d.ts +29 -0
  42. package/dist/parsers/DefineParser.d.ts +18 -0
  43. package/dist/parsers/EventParser.d.ts +17 -0
  44. package/dist/parsers/ExpressionParser.d.ts +3 -0
  45. package/dist/parsers/FenceClassifier.d.ts +29 -0
  46. package/dist/parsers/ForLoopParser.d.ts +17 -0
  47. package/dist/parsers/IfBlockParser.d.ts +17 -0
  48. package/dist/parsers/ObjectLiteralParser.d.ts +17 -0
  49. package/dist/parsers/ParserUtils.d.ts +15 -0
  50. package/dist/parsers/PromptBlockParser.d.ts +10 -0
  51. package/dist/parsers/ReturnParser.d.ts +16 -0
  52. package/dist/parsers/ScopeParser.d.ts +24 -0
  53. package/dist/parsers/StringTemplateParser.d.ts +31 -0
  54. package/dist/parsers/SubexpressionParser.d.ts +33 -0
  55. package/dist/parsers/TogetherBlockParser.d.ts +18 -0
  56. package/dist/parsers/WithScopeParser.d.ts +24 -0
  57. package/dist/types/Ast.type.d.ts +455 -0
  58. package/dist/types/Environment.type.d.ts +53 -0
  59. package/dist/utils/args.d.ts +24 -0
  60. package/dist/utils/errorFormatter.d.ts +22 -0
  61. package/dist/utils/index.d.ts +8 -0
  62. package/dist/utils/stringParsing.d.ts +41 -0
  63. package/dist/utils/types.d.ts +15 -0
  64. package/dist/utils/valueConversion.d.ts +25 -0
  65. 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
+ }