klue-langcraft 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/generators/project-plan.rb +5 -0
- data/CHANGELOG.md +14 -0
- data/README.md +0 -2
- data/docs/dsl-examples.md +105 -0
- data/docs/dsl-rules.md +155 -0
- data/docs/dsl-samples/index.md +4 -0
- data/docs/dsl-samples/youtube-launch-optimizer-old.klue +300 -0
- data/docs/dsl-samples/youtube-launch-optimizer-strawberry.json +132 -0
- data/docs/dsl-samples/youtube-launch-optimizer-strawberry.klue +47 -0
- data/docs/dsl-samples/youtube-launch-optimizer.defn.klue +51 -0
- data/docs/dsl-samples/youtube-launch-optimizer.json +337 -0
- data/docs/dsl-samples/youtube-launch-optimizer.klue +47 -0
- data/docs/project-plan/project.drawio +27 -21
- data/docs/project-plan/project_done.svg +1 -1
- data/docs/project-plan/project_in_progress.svg +1 -1
- data/docs/project-plan/project_todo.svg +1 -1
- data/lib/klue/langcraft/-brief.md +357 -0
- data/lib/klue/langcraft/parser.rb +78 -0
- data/lib/klue/langcraft/sample_usage.rb +15 -0
- data/lib/klue/langcraft/tokenizer.rb +20 -0
- data/lib/klue/langcraft/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +15 -2
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Read DSL code from file
|
4
|
+
dsl_code = File.read('workflow_dsl.rb')
|
5
|
+
|
6
|
+
# Tokenize the DSL code
|
7
|
+
tokenizer = Tokenizer.new(dsl_code)
|
8
|
+
tokenizer.tokenize
|
9
|
+
|
10
|
+
# Parse tokens into an AST
|
11
|
+
parser = Parser.new(tokenizer.tokens, schema)
|
12
|
+
ast = parser.parse
|
13
|
+
|
14
|
+
# Output the AST
|
15
|
+
puts ast.inspect
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Klue
|
4
|
+
module Langcraft
|
5
|
+
# Tokenizer class
|
6
|
+
class Tokenizer
|
7
|
+
attr_reader :tokens
|
8
|
+
|
9
|
+
def initialize(code)
|
10
|
+
@code = code
|
11
|
+
@tokens = []
|
12
|
+
end
|
13
|
+
|
14
|
+
def tokenize
|
15
|
+
# Implement logic to convert code into tokens
|
16
|
+
# Handle strings, symbols, keywords, and delimiters
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "klue-langcraft",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "0.1.0",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "klue-langcraft",
|
9
|
-
"version": "0.0
|
9
|
+
"version": "0.1.0",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.3",
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klue-langcraft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: k_log
|
@@ -48,12 +48,25 @@ files:
|
|
48
48
|
- Rakefile
|
49
49
|
- bin/console
|
50
50
|
- bin/setup
|
51
|
+
- docs/dsl-examples.md
|
52
|
+
- docs/dsl-rules.md
|
53
|
+
- docs/dsl-samples/index.md
|
54
|
+
- docs/dsl-samples/youtube-launch-optimizer-old.klue
|
55
|
+
- docs/dsl-samples/youtube-launch-optimizer-strawberry.json
|
56
|
+
- docs/dsl-samples/youtube-launch-optimizer-strawberry.klue
|
57
|
+
- docs/dsl-samples/youtube-launch-optimizer.defn.klue
|
58
|
+
- docs/dsl-samples/youtube-launch-optimizer.json
|
59
|
+
- docs/dsl-samples/youtube-launch-optimizer.klue
|
51
60
|
- docs/project-plan/project-plan.md
|
52
61
|
- docs/project-plan/project.drawio
|
53
62
|
- docs/project-plan/project_done.svg
|
54
63
|
- docs/project-plan/project_in_progress.svg
|
55
64
|
- docs/project-plan/project_todo.svg
|
56
65
|
- lib/klue/langcraft.rb
|
66
|
+
- lib/klue/langcraft/-brief.md
|
67
|
+
- lib/klue/langcraft/parser.rb
|
68
|
+
- lib/klue/langcraft/sample_usage.rb
|
69
|
+
- lib/klue/langcraft/tokenizer.rb
|
57
70
|
- lib/klue/langcraft/version.rb
|
58
71
|
- package-lock.json
|
59
72
|
- package.json
|