mvinl 0.1.3 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f891e7bb1683b84d918155e32b06fdf03ae4d00791676e4b1dc467c30d495b90
4
- data.tar.gz: c96e8a9930ed532580014843594d70d3fb025089fdd06708e9440b5316c2a772
3
+ metadata.gz: 4ceac64e8ec7e1ff3f8fab41d82d4b69a577098bca195f7ed01205dfc3b54b2d
4
+ data.tar.gz: f8592113d9ac37d001048f8f49c4e46e4c1f09d6209e32800f73f821549fab61
5
5
  SHA512:
6
- metadata.gz: febf482245e910fe310efae6a5aaaa115769830475678ba8b0e8b0d65dee6b0b4e22f5a4d9d5e5236f5a8e35e0125f55d406a155c6e2b3e4441ced8f7dfe05de
7
- data.tar.gz: fb604a7c640da0406c0d0a1190ba0a684491728cd1b9b666da5e870bd754b50d8ebde6ad5a2e3dfea0aecab98e98fc60e7dfbb3d35f94526d5294e981ef91bb1
6
+ metadata.gz: e31891e65cde3f3de7124ec7665eaf89561f3a5db04201e03c316ee214e09b5d67db5f79d108eee5ddeae30daaddea187dbe27bcec2881aa7ff1bb4970b50536
7
+ data.tar.gz: 2b05bef7791eec6129ba210fd146f3ea575098d7ab70afe44cf709297319d2915ad7d5c876cf0dfe64a9f177dc299bb46a17a3769ed40d0317b77d6d0ebdbeb2
data/README.md CHANGED
@@ -15,8 +15,8 @@ gem install mvinl
15
15
  or build and install it from this repo if you have it downloaded
16
16
 
17
17
  ```
18
- gem build
19
- gem install ./mvinl-0.1.0.gem
18
+ rake build
19
+ rake install
20
20
  ```
21
21
 
22
22
  ## Usage
@@ -46,7 +46,7 @@ def (center x (/ x 2))
46
46
  Buttom (center 1920)
47
47
  (center 1080)
48
48
  "Hello, MVinl!"
49
- font_size: 21 # END_TAG is optional
49
+ font_size: 21 # END_TAG is optional
50
50
  ```
51
51
 
52
52
  ## Contribute
data/Rakefile CHANGED
@@ -1,5 +1,11 @@
1
- task default: %w[spec]
1
+ # frozen-string-literal: true
2
2
 
3
- task :spec do
4
- rspec
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec, :tag) do |t, task_args|
6
+ t.rspec_opts = ENV['SPEC_OPTS'] || '--format documentation'
7
+ end
8
+ task default: :spec
9
+ rescue LoadError
10
+ warn 'Could not run rspec'
5
11
  end
data/bin/imvnl CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen-string-literal: true
3
3
 
4
- =begin engine.rb
4
+ =begin imvnl
5
5
  Copyright (c) 2018, 2024, Daniel Sierpiński All rights reserved.
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -27,14 +27,16 @@ require 'readline'
27
27
  require 'pry'
28
28
  require 'mvinl/lexer'
29
29
  require 'mvinl/parser'
30
+ require 'mvinl/context'
30
31
  require 'mvinl/info'
31
32
 
32
33
  PSL = "mvnl(#{MVinl::Version})".freeze
33
34
  PS1 = "#{PSL}>".freeze
34
35
 
35
36
  module MVinl::REPL
36
- LEXER = MVinl::Lexer.new('')
37
- PARSER = MVinl::Parser.new(LEXER)
37
+ CONTEXT = MVinl::Context.new
38
+ LEXER = MVinl::Lexer.new(CONTEXT, '')
39
+ PARSER = MVinl::Parser.new(LEXER, CONTEXT)
38
40
 
39
41
  def self.run
40
42
  while (input = Readline.readline("#{PS1} ", true))
@@ -0,0 +1,24 @@
1
+ # frozen-string-literal: true
2
+
3
+ module MVinl
4
+ # Lexer and parser shared context
5
+ class Context
6
+ attr_accessor :variables, :functions, :state
7
+
8
+ def initialize
9
+ reset
10
+ end
11
+
12
+ def reset
13
+ @variables = {}
14
+ @functions = {}
15
+ @state = {
16
+ in_prop: false,
17
+ in_var: false,
18
+ in_keyword_arg: false,
19
+ keyword_arg_depth: 0,
20
+ depth: 0
21
+ }
22
+ end
23
+ end
24
+ end
data/lib/mvinl/info.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  # frozen-string-literal: true
2
2
 
3
- # engine.rb
3
+ # info.rb
4
4
  # Copyright (c) 2024, Daniel Sierpiński All rights reserved.
5
5
  #
6
6
  # See Copyright Notice in mvnil.rb
7
7
 
8
8
  module MVinl
9
- VERSION = '0.1.3'
9
+ VERSION = '0.1.5'
10
10
  Version = VERSION
11
11
  Copyright = 'Copyright (c) 2024, Daniel Sierpiński'
12
12
  end
data/lib/mvinl/lexer.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen-string-literal: true
2
2
 
3
- =begin engine.rb
3
+ =begin lexer.rb
4
4
  Copyright (c) 2024, Daniel Sierpiński All rights reserved.
5
5
 
6
6
  See Copyright Notice in mvnil.rb
@@ -28,7 +28,10 @@ module MVinl
28
28
  KEYWORD_ARG: /(#{ID_REGEX}):/,
29
29
  ID: ID_REGEX,
30
30
  GROUP: /@(#{ID_REGEX})/,
31
+ VARIABLE: /!(#{ID_REGEX})/,
32
+ FLOAT: /[+-]?\d+\.\d+/,
31
33
  NUMBER: /[+-]?\d+/,
34
+ MULTILINE_STRING: /"((?:\\.|[^"\\])*)"\s*\\\s*/,
32
35
  STRING: /"((?:\\.|[^"\\])*)"/,
33
36
  SYMBOL: /:(#{ID_REGEX})/,
34
37
  COMMENT: /#/,
@@ -36,7 +39,8 @@ module MVinl
36
39
  END_TAG: /\./
37
40
  }.freeze
38
41
 
39
- def initialize(input)
42
+ def initialize(context, input = '')
43
+ @context = context
40
44
  @ss = StringScanner.new(input)
41
45
  @args_n = 0
42
46
  @in_group = false
@@ -50,6 +54,11 @@ module MVinl
50
54
  def next_token
51
55
  return process_eos if @ss.eos?
52
56
 
57
+ # Check if variable name been used
58
+ @context.variables.each_key do |var_name|
59
+ return [:VARIABLE_CALL, @context.variables[var_name]] if @ss.scan(/\A#{Regexp.escape var_name.to_s}\b/)
60
+ end
61
+
53
62
  TOKENS.each do |type, regex|
54
63
  if @ss.scan regex
55
64
  @last_type = type
@@ -70,13 +79,13 @@ module MVinl
70
79
  next_token
71
80
  when :OPEN_PAREN then [:OPEN_PAREN, '(']
72
81
  when :CLOSE_PAREN
73
- unless Parser::STATE[:depth].positive?
74
- raise UnexpectedTokenError, 'CLOSE_PARAM found winth no matching OPEN_PARAM'
82
+ unless @context.state[:depth].positive?
83
+ raise UnexpectedTokenError, 'CLOSE_PARAM found with no matching OPEN_PARAM'
75
84
  end
76
85
 
77
86
  [:CLOSE_PAREN, ')']
78
87
  when :OPER
79
- unless Parser::STATE[:depth].positive?
88
+ unless @context.state[:depth].positive?
80
89
  raise UnexpectedTokenError, 'OPER found with no matching OPEN_PARAM'
81
90
  end
82
91
 
@@ -86,28 +95,29 @@ module MVinl
86
95
 
87
96
  [:KEYWORD, @ss.matched]
88
97
  when :KEYWORD_ARG
89
- if !Parser::STATE[:in_prop]
98
+ if !@context.state[:in_prop]
90
99
  raise UnexpectedTokenError, 'Looking for identifier but found KEYWORD_ARG'
91
- elsif Parser::STATE[:in_keyword_arg]
100
+ elsif @context.state[:in_keyword_arg]
92
101
  raise UnexpectedTokenError, 'Looking for a keyword argument value but found KEYWORD_ARG'
93
102
  end
94
103
 
95
104
  [:KEYWORD_ARG, @ss[1]]
96
105
  when :GROUP
97
106
  # Group gets canceled whenever encountered another group id or a matching end tag
98
- if Parser::STATE[:in_keyword_arg]
107
+ if @context.state[:in_keyword_arg]
99
108
  raise UnexpectedTokenError, 'Looking for a keyword argument value but found GROUP'
100
109
  end
101
110
 
102
111
  @in_group = true
103
112
  [:GROUP, @ss[1]]
113
+ when :VARIABLE then [:VARIABLE, @ss[1]]
104
114
  when :ID then [:ID, @ss.matched]
105
- when :NUMBER, :STRING, :SYMBOL
115
+ when :NUMBER, :FLOAT, :STRING, :SYMBOL, :MULTILINE_STRING
106
116
  # Values can't be used outside an property or a lambda
107
- if !Parser::STATE[:in_prop] && !Parser::STATE[:depth].positive?
117
+ if !@context.state[:in_prop] && !@context.state[:depth].positive? && !@context.state[:in_var]
108
118
  raise UnexpectedTokenError, "Looking for ID or OPEN_PAREN but found #{@last_type}"
109
- elsif !Parser::STATE[:in_keyword_arg] && Parser::STATE[:keyword_arg_depth].positive? &&
110
- !Parser::STATE[:depth].positive?
119
+ elsif !@context.state[:in_keyword_arg] && @context.state[:keyword_arg_depth].positive? &&
120
+ !@context.state[:depth].positive? && !@context.state[:in_var]
111
121
  raise UnexpectedTokenError, "Looking for END_TAG or KEYWORD_ARG but found #{@last_type}"
112
122
  end
113
123
 
@@ -136,8 +146,8 @@ module MVinl
136
146
 
137
147
  # Auto end properties
138
148
  lookahead = @ss.check(/\A(?:#{TOKENS[:GROUP]}|#{TOKENS[:ID]}$|#{TOKENS[:END_TAG]}|#{TOKENS[:NEW_LINE]})/)
139
- warn "Continue? in_prop?: #{Parser::STATE[:in_prop].inspect}, lookahead: #{lookahead.inspect}"
140
- Parser::STATE[:in_prop] ? !lookahead : true
149
+ warn "Continue? in_prop?: #{@context.state[:in_prop].inspect}, lookahead: #{lookahead.inspect}"
150
+ @context.state[:in_prop] ? !lookahead : true
141
151
  end
142
152
 
143
153
  # Move the cursor to the next new line tag
data/lib/mvinl/parser.rb CHANGED
@@ -1,22 +1,32 @@
1
1
  # frozen-string-literal: true
2
2
 
3
- =begin engine.rb
3
+ =begin parser.rb
4
4
  Copyright (c) 2024, Daniel Sierpiński All rights reserved.
5
5
 
6
6
  See Copyright Notice in mvnil.rb
7
7
  =end
8
8
 
9
- require_relative '../../syntax/mvinl.tab'
9
+ require 'mvinl.tab'
10
10
 
11
+ # Generated parser class
11
12
  class MVinl::Parser < MVinl::Program
12
- def initialize(lexer, debug: false)
13
- @yydebug = debug
13
+ def initialize(lexer, context, debug: false)
14
14
  @lexer = lexer
15
+ @context = context
16
+ @yydebug = debug
15
17
  @tokens = []
16
18
  @done = false
17
19
  super()
18
20
  end
19
21
 
22
+ def parse
23
+ do_parse
24
+ end
25
+
26
+ def feed(input)
27
+ @lexer.feed input
28
+ end
29
+
20
30
  def next_token
21
31
  if @tokens.empty?
22
32
  @lexer.next_token
@@ -36,8 +46,4 @@ class MVinl::Parser < MVinl::Program
36
46
  def parsing_done?
37
47
  @done && @tokens.empty?
38
48
  end
39
-
40
- def parse
41
- do_parse
42
- end
43
49
  end
data/lib/mvinl.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen-string-literal: true
2
2
 
3
- =begin engine.rb
3
+ =begin mvinl.rb
4
4
  Copyright (c) 2018, 2024, Daniel Sierpiński All rights reserved.
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,14 +24,27 @@ THE SOFTWARE.
24
24
 
25
25
  require 'mvinl/parser'
26
26
  require 'mvinl/lexer'
27
+ require 'mvinl/context'
27
28
 
29
+ # Library entry point
28
30
  module MVinl
31
+ @context = Context.new
32
+ @parser = Parser.new(Lexer.new(@context, ''), @context)
33
+
29
34
  def self.eval(input)
30
- parser = Parser.new(Lexer.new(input))
31
- parser.parse
35
+ @parser.feed input
36
+ @parser.parse
32
37
  end
33
38
 
34
39
  def self.eval_from_file(path)
35
40
  self.eval File.read(path)
36
41
  end
42
+
43
+ def self.context
44
+ @context
45
+ end
46
+
47
+ def self.reset
48
+ @context.reset
49
+ end
37
50
  end
data/mvinl.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  # Compile syntax file
27
27
  s.files.delete(GRAMMAR_FILE)
28
28
  s.files << COMPILED_FILE
29
- s.require_paths = %w[lib bin s rakelib syntax]
29
+ s.require_paths = %w[lib syntax]
30
30
  s.executables << 'imvnl'
31
31
 
32
32
  s.add_dependency 'pp', '~> 0.6.2'
data/rakelib/build.rake CHANGED
@@ -1,8 +1,11 @@
1
1
  # frozen-string-literal: true
2
2
 
3
- GRAMMAR_FILE = 'syntax/mvinl.y'
4
- COMPILED_FILE = 'syntax/mvinl.tab.rb'
3
+ require 'bundler/gem_tasks'
5
4
 
6
- task 'build' do
5
+ desc 'Push MVinl gem; use this task in stead of \'release\''
6
+ task push: %I[compile build release]
7
+
8
+ desc 'Compile the grammar file'
9
+ task :compile do
7
10
  system('racc', GRAMMAR_FILE, '-o', COMPILED_FILE)
8
11
  end
@@ -0,0 +1,116 @@
1
+ # frozen-string-literal: true
2
+
3
+ require_relative 'spec_helper'
4
+ require 'mvinl'
5
+ require 'pry'
6
+
7
+ describe MVinl, '#eval' do
8
+ context 'no input' do
9
+ it 'returns an empty hash' do
10
+ result = MVinl.eval('')
11
+ expect(result).to eq({})
12
+ end
13
+ end
14
+
15
+ context 'groups' do
16
+ it 'retruns a single group' do
17
+ result = MVinl.eval('@x')
18
+ expect(result).to eq({ x: {} })
19
+ end
20
+ it 'returns two groups' do
21
+ result = MVinl.eval('@x @y')
22
+ expect(result).to eq({ x: {}, y: {} })
23
+ end
24
+ end
25
+
26
+ context 'properties' do
27
+ it 'return a single property' do
28
+ result = MVinl.eval('@x a')
29
+ expect(result).to eq({ x: { a: [[], {}] } })
30
+ end
31
+ it 'returns two properties' do
32
+ result = MVinl.eval('@x a b')
33
+ expect(result).to eq({ x: { a: [[], {}], b: [[], {}] } })
34
+ end
35
+ end
36
+
37
+ context 'variables' do
38
+ it 'stores a single variable' do
39
+ MVinl.eval('!n 0')
40
+ expect(MVinl.context.variables[:n]).to be_truthy
41
+ end
42
+ it 'stores a two variables' do
43
+ MVinl.eval('!n 3 !m 6')
44
+ expect(MVinl.context.variables[:n] && MVinl.context.variables[:m]).to be_truthy
45
+ end
46
+ it 'stores a single variable with it\'s value' do
47
+ MVinl.eval('!n 5')
48
+ expect(MVinl.context.variables[:n]).to eq 5
49
+ end
50
+ it 'evaluates a single variable' do
51
+ result = MVinl.eval('!n 5 x n')
52
+ expect(result).to eq({ x: [[5], {}] })
53
+ end
54
+ end
55
+
56
+ context 'functions' do
57
+ it 'stores function definition with \'+\' OPER and no arguments' do
58
+ MVinl.eval('def (f (+ 1))')
59
+ expect(MVinl.context.functions).to eq({ f: { args: [], body: [:+, 1] } })
60
+ end
61
+ it 'stores function definition with \'-\' OPER and no arguments' do
62
+ MVinl.eval('def (f (- 1))')
63
+ expect(MVinl.context.functions).to eq({ f: { args: [], body: [:-, 1] } })
64
+ end
65
+ it 'stores function definition with \'*\' OPER and no arguments' do
66
+ MVinl.eval('def (f (* 1))')
67
+ expect(MVinl.context.functions).to eq({ f: { args: [], body: [:*, 1] } })
68
+ end
69
+ it 'stores function definition with \'/\' OPER and no arguments' do
70
+ MVinl.eval('def (f (/ 1))')
71
+ expect(MVinl.context.functions).to eq({ f: { args: [], body: [:/, 1] } })
72
+ end
73
+ it 'stores function definition with \'%\' OPER and no arguments' do
74
+ MVinl.eval('def (f (% 1))')
75
+ expect(MVinl.context.functions).to eq({ f: { args: [], body: [:%, 1] } })
76
+ end
77
+ it 'stores function definition with a single argument' do
78
+ MVinl.eval('def (f a (+ a a))')
79
+ expect(MVinl.context.functions).to eq({ f: { args: %I[a], body: %I[+ a a] } })
80
+ end
81
+ it 'stores function definition with two arguments' do
82
+ MVinl.eval('def (f a b (+ a b))')
83
+ expect(MVinl.context.functions).to eq({ f: { args: %I[a b], body: %I[+ a b] } })
84
+ end
85
+ it 'evaluates anonimous function' do
86
+ result = MVinl.eval('x (+ 2 2)')
87
+ expect(result).to eq({ x: [[4], {}] })
88
+ end
89
+ it 'evaluates function' do
90
+ result = MVinl.eval('def (foo (+ 5)) x (foo)')
91
+ expect(result).to eq({ x: [[5], {}] })
92
+ end
93
+ it 'evaluates function calling another function' do
94
+ result = MVinl.eval('def (foo (+ 5)) def (bar (foo)) x (bar)')
95
+ expect(result).to eq({ x: [[5], {}] })
96
+ end
97
+ it 'evaluates function inside a variable' do
98
+ MVinl.eval('def (foo (+ 7)) !n (foo)')
99
+ expect(MVinl.context.variables[:n]).to eq 7
100
+ end
101
+ end
102
+ end
103
+
104
+ describe MVinl, '#eval_from_file' do
105
+ context 'stack example' do
106
+ it 'evaluates a basic example' do
107
+ MVinl.reset
108
+ result = MVinl.eval_from_file('spec/stack.mvnl')
109
+ expect(result).to eq({ menu: { Menu: [[], { New_Game: :state_next, Exit: :abord }] },
110
+ game: { Mouse: [[], {}], Board: [[3, 3], {}],
111
+ Button: [['󰮱 Hello Vinl!'], {
112
+ line_height: 25, padding: 8
113
+ }] } })
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,3 @@
1
+ # frozen-string-literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('lib', __dir__)
data/syntax/mvinl.tab.rb CHANGED
@@ -8,22 +8,13 @@ require 'racc/parser.rb'
8
8
  module MVinl
9
9
  class Program < Racc::Parser
10
10
 
11
- module_eval(<<'...end mvinl.y/module_eval...', 'mvinl.y', 105)
12
-
13
- FUNCTIONS = {}
14
- STATE = {
15
- in_prop: false,
16
- in_keyword_arg: false,
17
- keyword_arg_depth: 0,
18
- depth: 0
19
- }
20
-
11
+ module_eval(<<'...end mvinl.y/module_eval...', 'mvinl.y', 121)
21
12
  class MVinl::ParserError < StandardError; end
22
13
 
23
14
  private
24
15
 
25
16
  def create_property(id, positional_args = [], keyword_args = {})
26
- STATE[:in_prop] = false
17
+ @context.state[:in_prop] = false
27
18
  {id => [positional_args, keyword_args]}
28
19
  end
29
20
 
@@ -31,8 +22,15 @@ module_eval(<<'...end mvinl.y/module_eval...', 'mvinl.y', 105)
31
22
  properties || Hash.new
32
23
  end
33
24
 
25
+
26
+ def define_variable(name, value)
27
+ @context.state[:in_var] = false
28
+ @context.variables[name] = value
29
+ value
30
+ end
31
+
34
32
  def define_function(name, args, body)
35
- FUNCTIONS[name.to_sym] = {args: args, body: body}
33
+ @context.functions[name.to_sym] = {args: args, body: body}
36
34
  nil
37
35
  end
38
36
 
@@ -47,8 +45,8 @@ module_eval(<<'...end mvinl.y/module_eval...', 'mvinl.y', 105)
47
45
  end
48
46
  end
49
47
 
50
- if FUNCTIONS.key?(operator.to_sym)
51
- function = FUNCTIONS[operator.to_sym]
48
+ if @context.functions.key?(operator)
49
+ function = @context.functions[operator]
52
50
  raise MVinl::ParserError, "Argument mismatch for #{operator}" if operands.size != function[:args].size
53
51
 
54
52
  # Map arguments to operands
@@ -59,7 +57,7 @@ module_eval(<<'...end mvinl.y/module_eval...', 'mvinl.y', 105)
59
57
  evaluate_pn(function[0], function[1..], new_context)
60
58
  else
61
59
  begin
62
- operands.reduce(operator.to_sym)
60
+ operands.reduce(operator)
63
61
  rescue NoMethodError
64
62
  raise MVinl::ParserError, "Unknown operator: #{operator}"
65
63
  end
@@ -81,126 +79,152 @@ module_eval(<<'...end mvinl.y/module_eval...', 'mvinl.y', 105)
81
79
  ##### State transition tables begin ###
82
80
 
83
81
  racc_action_table = [
84
- 2, 8, 5, 6, 30, 26, 27, 28, 15, 7,
85
- 11, 11, 15, 15, 26, 27, 28, 15, 17, 11,
86
- 41, 48, 15, 26, 27, 28, 37, 41, 11, 41,
87
- 48, 15, 26, 27, 28, 43, nil, 11, 41, 15,
88
- 15, 26, 27, 28, nil, nil, 11, 41, nil, 15,
89
- -14, -14, -14, -14, nil, nil, 11, -16, 26, 27,
90
- 28, nil, nil, 11, 26, 27, 28, nil, nil, 11 ]
82
+ -13, 12, -13, -13, -13, -13, 2, 16, 7, 9,
83
+ 10, 25, 26, -13, 36, 16, 36, 16, -13, 11,
84
+ 20, 21, 22, 24, 25, 26, 28, 28, 47, 50,
85
+ 31, 16, 20, 21, 22, 24, 25, 26, 16, 28,
86
+ 47, 50, 16, 16, 21, 22, 24, 25, 26, 45,
87
+ 28, 47, nil, nil, 16, 21, 22, 24, 25, 26,
88
+ nil, 28, 47, nil, nil, 16, 21, 22, 24, 25,
89
+ 26, nil, 28, 47, nil, nil, 16, -19, 20, 21,
90
+ 22, 24, 25, 26, nil, 28, 20, 21, 22, 24,
91
+ 25, 26, nil, 28, 20, 21, 22, 24, 25, 26,
92
+ nil, 28 ]
91
93
 
92
94
  racc_action_check = [
93
- 1, 2, 1, 1, 20, 21, 21, 21, 20, 1,
94
- 21, 7, 9, 21, 38, 38, 38, 10, 12, 38,
95
- 38, 38, 38, 39, 39, 39, 22, 31, 39, 39,
96
- 39, 39, 50, 50, 50, 32, nil, 50, 50, 32,
97
- 50, 51, 51, 51, nil, nil, 51, 51, nil, 51,
98
- 13, 13, 13, 13, nil, nil, 13, 18, 18, 18,
99
- 18, nil, nil, 18, 36, 36, 36, nil, nil, 36 ]
95
+ 14, 2, 14, 14, 14, 14, 1, 4, 1, 1,
96
+ 1, 26, 26, 14, 27, 27, 53, 53, 14, 1,
97
+ 40, 40, 40, 40, 40, 40, 11, 40, 40, 40,
98
+ 13, 40, 41, 41, 41, 41, 41, 41, 29, 41,
99
+ 41, 41, 30, 41, 42, 42, 42, 42, 42, 38,
100
+ 42, 52, nil, nil, 42, 60, 60, 60, 60, 60,
101
+ nil, 60, 60, nil, nil, 60, 61, 61, 61, 61,
102
+ 61, nil, 61, 61, nil, nil, 61, 32, 32, 32,
103
+ 32, 32, 32, 32, nil, 32, 8, 8, 8, 8,
104
+ 8, 8, nil, 8, 44, 44, 44, 44, 44, 44,
105
+ nil, 44 ]
100
106
 
101
107
  racc_action_pointer = [
102
- nil, 0, 1, nil, nil, nil, nil, 0, nil, -2,
103
- 3, nil, 14, 45, nil, nil, nil, nil, 52, nil,
104
- -6, -1, 21, nil, nil, nil, nil, nil, nil, nil,
105
- nil, 15, 25, nil, nil, nil, 58, nil, 8, 17,
106
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
107
- 26, 35, nil, nil, nil ]
108
+ nil, 6, 1, nil, -11, nil, nil, nil, 79, nil,
109
+ nil, 12, nil, 25, 0, nil, nil, nil, nil, nil,
110
+ nil, nil, nil, nil, nil, nil, 0, -3, nil, 20,
111
+ 24, nil, 71, nil, nil, nil, nil, nil, 43, nil,
112
+ 13, 25, 36, nil, 87, nil, nil, nil, nil, nil,
113
+ nil, nil, 36, -1, nil, nil, nil, nil, nil, nil,
114
+ 47, 58, nil, nil, nil ]
108
115
 
109
116
  racc_action_default = [
110
- -1, -41, -41, -2, -3, -4, -6, -41, 55, -5,
111
- -41, -30, -7, -9, -13, -40, -32, -8, -10, -12,
112
- -41, -41, -11, -15, -20, -21, -22, -23, -24, -36,
113
- -36, -35, -41, -33, -34, -17, -41, -19, -41, -41,
114
- -25, -31, -32, -32, -18, -28, -37, -38, -39, -29,
115
- -41, -41, -26, -35, -27 ]
117
+ -1, -10, -49, -2, -3, -4, -5, -6, -49, -8,
118
+ -10, -49, 65, -11, -17, -16, -48, -7, -23, -24,
119
+ -25, -26, -27, -28, -29, -30, -49, -49, -37, -9,
120
+ -49, -12, -14, -31, -43, -43, -47, -39, -15, -18,
121
+ -49, -49, -49, -20, -49, -22, -35, -38, -44, -45,
122
+ -46, -36, -42, -49, -40, -41, -21, -32, -39, -39,
123
+ -49, -49, -33, -42, -34 ]
116
124
 
117
125
  racc_goto_table = [
118
- 10, 14, 16, 34, 23, 38, 39, 1, 21, 40,
119
- 3, 4, 29, 9, 32, 12, 45, 49, 13, 18,
120
- 22, 19, 44, 35, 42, 36, 31, nil, 52, 54,
121
- 47, 47, 34, 34, 50, 51, nil, nil, nil, nil,
122
- nil, nil, nil, 32, 32 ]
126
+ 30, 42, 15, 1, 35, 17, 4, 40, 41, 3,
127
+ 5, 6, 46, 51, 8, 29, 55, 32, 38, 43,
128
+ 44, 33, 60, 61, 57, 34, 52, 15, 37, 39,
129
+ 59, 53, 62, 64, 55, 55, nil, nil, 49, 49,
130
+ nil, 56, nil, nil, nil, nil, nil, nil, nil, 53,
131
+ 53, 58 ]
123
132
 
124
133
  racc_goto_check = [
125
- 15, 10, 10, 14, 11, 19, 19, 1, 16, 18,
126
- 2, 3, 10, 4, 15, 5, 18, 18, 6, 7,
127
- 8, 9, 11, 12, 10, 13, 17, nil, 18, 18,
128
- 10, 10, 14, 14, 16, 16, nil, nil, nil, nil,
129
- nil, nil, nil, 15, 15 ]
134
+ 18, 19, 12, 1, 22, 7, 3, 23, 23, 2,
135
+ 4, 5, 21, 21, 6, 3, 15, 10, 11, 13,
136
+ 14, 17, 19, 19, 21, 12, 20, 12, 12, 7,
137
+ 22, 18, 21, 21, 15, 15, nil, nil, 12, 12,
138
+ nil, 7, nil, nil, nil, nil, nil, nil, nil, 18,
139
+ 18, 12 ]
130
140
 
131
141
  racc_goto_pointer = [
132
- nil, 7, 9, 10, 7, 6, 9, 6, 2, 8,
133
- -8, -14, 1, 3, -18, -7, -8, 5, -22, -24 ]
142
+ nil, 3, 8, 5, 9, 10, 13, -3, nil, nil,
143
+ 3, -14, -2, -19, -18, -26, nil, -5, -11, -36,
144
+ -16, -28, -23, -27 ]
134
145
 
135
146
  racc_goto_default = [
136
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 25,
137
- 33, 46, nil, nil, 24, 20, nil, 53, nil, nil ]
147
+ nil, nil, nil, nil, nil, nil, nil, 48, 13, 14,
148
+ nil, nil, 54, nil, nil, 18, 19, 23, 27, nil,
149
+ 63, nil, nil, nil ]
138
150
 
139
151
  racc_reduce_table = [
140
152
  0, 0, :racc_error,
141
- 0, 16, :_reduce_1,
142
- 2, 16, :_reduce_2,
143
- 2, 16, :_reduce_3,
144
- 2, 16, :_reduce_4,
145
- 2, 17, :_reduce_5,
146
- 0, 19, :_reduce_6,
147
- 2, 19, :_reduce_7,
148
- 3, 19, :_reduce_8,
149
- 1, 20, :_reduce_9,
150
- 2, 20, :_reduce_10,
151
- 3, 20, :_reduce_11,
152
- 2, 20, :_reduce_12,
153
- 1, 21, :_reduce_13,
154
- 0, 22, :_reduce_14,
155
- 2, 22, :_reduce_15,
156
- 0, 23, :_reduce_16,
157
- 2, 23, :_reduce_17,
158
- 2, 27, :_reduce_18,
159
- 1, 28, :_reduce_19,
160
- 1, 26, :_reduce_20,
161
- 1, 26, :_reduce_21,
162
- 1, 29, :_reduce_22,
163
- 1, 29, :_reduce_23,
164
- 1, 29, :_reduce_24,
165
- 6, 18, :_reduce_25,
166
- 4, 32, :_reduce_26,
167
- 4, 32, :_reduce_27,
168
- 4, 24, :_reduce_28,
169
- 4, 24, :_reduce_29,
170
- 1, 30, :_reduce_30,
171
- 1, 33, :_reduce_31,
172
- 0, 31, :_reduce_32,
173
- 2, 31, :_reduce_33,
174
- 2, 31, :_reduce_34,
175
- 2, 31, :_reduce_35,
176
- 0, 34, :_reduce_36,
177
- 2, 34, :_reduce_37,
178
- 2, 34, :_reduce_38,
179
- 2, 34, :_reduce_39,
180
- 1, 25, :_reduce_40 ]
181
-
182
- racc_reduce_n = 41
183
-
184
- racc_shift_n = 55
153
+ 0, 20, :_reduce_1,
154
+ 2, 20, :_reduce_2,
155
+ 2, 20, :_reduce_3,
156
+ 2, 20, :_reduce_4,
157
+ 2, 20, :_reduce_5,
158
+ 2, 20, :_reduce_6,
159
+ 2, 23, :_reduce_7,
160
+ 1, 25, :_reduce_8,
161
+ 2, 21, :_reduce_9,
162
+ 0, 22, :_reduce_10,
163
+ 2, 22, :_reduce_11,
164
+ 3, 22, :_reduce_12,
165
+ 1, 27, :_reduce_13,
166
+ 2, 27, :_reduce_14,
167
+ 3, 27, :_reduce_15,
168
+ 1, 28, :_reduce_16,
169
+ 0, 29, :_reduce_17,
170
+ 2, 29, :_reduce_18,
171
+ 0, 30, :_reduce_19,
172
+ 2, 30, :_reduce_20,
173
+ 2, 32, :_reduce_21,
174
+ 1, 33, :_reduce_22,
175
+ 1, 26, :_reduce_23,
176
+ 1, 26, :_reduce_24,
177
+ 1, 26, :_reduce_25,
178
+ 1, 34, :_reduce_26,
179
+ 1, 34, :_reduce_27,
180
+ 1, 34, :_reduce_28,
181
+ 1, 34, :_reduce_29,
182
+ 1, 36, :_reduce_30,
183
+ 2, 36, :_reduce_31,
184
+ 6, 24, :_reduce_32,
185
+ 4, 39, :_reduce_33,
186
+ 4, 39, :_reduce_34,
187
+ 4, 35, :_reduce_35,
188
+ 4, 35, :_reduce_36,
189
+ 1, 37, :_reduce_37,
190
+ 1, 40, :_reduce_38,
191
+ 0, 38, :_reduce_39,
192
+ 2, 38, :_reduce_40,
193
+ 2, 38, :_reduce_41,
194
+ 2, 38, :_reduce_42,
195
+ 0, 42, :_reduce_43,
196
+ 2, 42, :_reduce_44,
197
+ 2, 42, :_reduce_45,
198
+ 2, 42, :_reduce_46,
199
+ 1, 41, :_reduce_47,
200
+ 1, 31, :_reduce_48 ]
201
+
202
+ racc_reduce_n = 49
203
+
204
+ racc_shift_n = 65
185
205
 
186
206
  racc_token_table = {
187
207
  false => 0,
188
208
  :error => 1,
189
209
  :EOS => 2,
190
- :GROUP => 3,
191
- :END_TAG => 4,
192
- :KEYWORD_ARG => 5,
193
- :NUMBER => 6,
194
- :STRING => 7,
195
- :SYMBOL => 8,
196
- :DEF => 9,
197
- :OPER => 10,
198
- :OPEN_PAREN => 11,
199
- :CLOSE_PAREN => 12,
200
- :polish_notation => 13,
201
- :ID => 14 }
202
-
203
- racc_nt_base = 15
210
+ :VARIABLE => 3,
211
+ :GROUP => 4,
212
+ :END_TAG => 5,
213
+ :KEYWORD_ARG => 6,
214
+ :VARIABLE_CALL => 7,
215
+ :NUMBER => 8,
216
+ :FLOAT => 9,
217
+ :SYMBOL => 10,
218
+ :STRING => 11,
219
+ :MULTILINE_STRING => 12,
220
+ :DEF => 13,
221
+ :OPEN_PAREN => 14,
222
+ :CLOSE_PAREN => 15,
223
+ :polish_notation => 16,
224
+ :OPER => 17,
225
+ :ID => 18 }
226
+
227
+ racc_nt_base = 19
204
228
 
205
229
  racc_use_result_var = false
206
230
 
@@ -225,37 +249,45 @@ Racc_token_to_s_table = [
225
249
  "$end",
226
250
  "error",
227
251
  "EOS",
252
+ "VARIABLE",
228
253
  "GROUP",
229
254
  "END_TAG",
230
255
  "KEYWORD_ARG",
256
+ "VARIABLE_CALL",
231
257
  "NUMBER",
232
- "STRING",
258
+ "FLOAT",
233
259
  "SYMBOL",
260
+ "STRING",
261
+ "MULTILINE_STRING",
234
262
  "DEF",
235
- "OPER",
236
263
  "OPEN_PAREN",
237
264
  "CLOSE_PAREN",
238
265
  "polish_notation",
266
+ "OPER",
239
267
  "ID",
240
268
  "$start",
241
269
  "program",
242
270
  "group",
243
- "function_def",
244
271
  "properties",
272
+ "variable_def",
273
+ "function_def",
274
+ "var_def_name",
275
+ "super_value",
245
276
  "property",
246
277
  "prop_id",
247
278
  "positional_args",
248
279
  "keyword_args",
249
- "lambda",
250
280
  "identifier",
251
- "super_value",
252
281
  "keyword_arg",
253
282
  "keyword_arg_id",
254
283
  "value",
284
+ "lambda",
285
+ "string",
255
286
  "open_paren",
256
287
  "args",
257
288
  "polish_notation_def",
258
289
  "close_paren",
290
+ "operator",
259
291
  "params" ]
260
292
  Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
261
293
 
@@ -279,7 +311,7 @@ module_eval(<<'.,.,', 'mvinl.y', 13)
279
311
 
280
312
  module_eval(<<'.,.,', 'mvinl.y', 14)
281
313
  def _reduce_3(val, _values)
282
- val[0]
314
+ val[0].merge(val[1])
283
315
  end
284
316
  .,.,
285
317
 
@@ -289,224 +321,272 @@ module_eval(<<'.,.,', 'mvinl.y', 15)
289
321
  end
290
322
  .,.,
291
323
 
292
- module_eval(<<'.,.,', 'mvinl.y', 18)
324
+ module_eval(<<'.,.,', 'mvinl.y', 16)
293
325
  def _reduce_5(val, _values)
294
- {val[0].to_sym => create_group(val[1])}
326
+ val[0]
295
327
  end
296
328
  .,.,
297
329
 
298
- module_eval(<<'.,.,', 'mvinl.y', 21)
330
+ module_eval(<<'.,.,', 'mvinl.y', 17)
299
331
  def _reduce_6(val, _values)
300
- Hash.new
332
+ val[0]
301
333
  end
302
334
  .,.,
303
335
 
304
- module_eval(<<'.,.,', 'mvinl.y', 22)
336
+ module_eval(<<'.,.,', 'mvinl.y', 20)
305
337
  def _reduce_7(val, _values)
306
- val[0].merge(val[1])
338
+ define_variable(val[0], val[1])
307
339
  end
308
340
  .,.,
309
341
 
310
342
  module_eval(<<'.,.,', 'mvinl.y', 23)
311
343
  def _reduce_8(val, _values)
312
- val[0].merge(val[1])
344
+ @context.state[:in_var] = true; val[0].to_sym
313
345
  end
314
346
  .,.,
315
347
 
316
348
  module_eval(<<'.,.,', 'mvinl.y', 26)
317
349
  def _reduce_9(val, _values)
318
- create_property(val[0])
350
+ {val[0].to_sym => create_group(val[1])}
319
351
  end
320
352
  .,.,
321
353
 
322
- module_eval(<<'.,.,', 'mvinl.y', 27)
354
+ module_eval(<<'.,.,', 'mvinl.y', 29)
323
355
  def _reduce_10(val, _values)
324
- create_property(val[0], val[1])
356
+ Hash.new
325
357
  end
326
358
  .,.,
327
359
 
328
- module_eval(<<'.,.,', 'mvinl.y', 28)
360
+ module_eval(<<'.,.,', 'mvinl.y', 30)
329
361
  def _reduce_11(val, _values)
330
- create_property(val[0], val[1], val[2])
362
+ val[0].merge(val[1])
331
363
  end
332
364
  .,.,
333
365
 
334
- module_eval(<<'.,.,', 'mvinl.y', 29)
366
+ module_eval(<<'.,.,', 'mvinl.y', 31)
335
367
  def _reduce_12(val, _values)
336
- create_property(val[0], val[1])
368
+ val[0].merge(val[1])
337
369
  end
338
370
  .,.,
339
371
 
340
- module_eval(<<'.,.,', 'mvinl.y', 32)
372
+ module_eval(<<'.,.,', 'mvinl.y', 34)
341
373
  def _reduce_13(val, _values)
342
- STATE[:in_prop] = true; val[0]
374
+ create_property(val[0])
343
375
  end
344
376
  .,.,
345
377
 
346
378
  module_eval(<<'.,.,', 'mvinl.y', 35)
347
379
  def _reduce_14(val, _values)
348
- Array.new
380
+ create_property(val[0], val[1])
349
381
  end
350
382
  .,.,
351
383
 
352
384
  module_eval(<<'.,.,', 'mvinl.y', 36)
353
385
  def _reduce_15(val, _values)
354
- val[0] << val[1]
386
+ create_property(val[0], val[1], val[2])
355
387
  end
356
388
  .,.,
357
389
 
358
390
  module_eval(<<'.,.,', 'mvinl.y', 39)
359
391
  def _reduce_16(val, _values)
360
- Hash.new
392
+ @context.state[:in_prop] = true; val[0]
361
393
  end
362
394
  .,.,
363
395
 
364
396
  module_eval(<<'.,.,', 'mvinl.y', 42)
365
397
  def _reduce_17(val, _values)
366
- STATE[:keyword_arg_depth] = 0
367
- val[0].merge(val[1])
368
-
398
+ Array.new
369
399
  end
370
400
  .,.,
371
401
 
372
- module_eval(<<'.,.,', 'mvinl.y', 49)
402
+ module_eval(<<'.,.,', 'mvinl.y', 43)
373
403
  def _reduce_18(val, _values)
374
- STATE[:in_keyword_arg] = false
375
- STATE[:keyword_arg_depth] += 1
376
- {val[0].to_sym => val[1]}
377
-
404
+ val[0] << val[1]
378
405
  end
379
406
  .,.,
380
407
 
381
- module_eval(<<'.,.,', 'mvinl.y', 55)
408
+ module_eval(<<'.,.,', 'mvinl.y', 46)
382
409
  def _reduce_19(val, _values)
383
- STATE[:in_keyword_arg] = true; val[0]
410
+ Hash.new
384
411
  end
385
412
  .,.,
386
413
 
387
- module_eval(<<'.,.,', 'mvinl.y', 58)
414
+ module_eval(<<'.,.,', 'mvinl.y', 49)
388
415
  def _reduce_20(val, _values)
389
- val[0]
416
+ @context.state[:keyword_arg_depth] = 0
417
+ val[0].merge(val[1])
418
+
390
419
  end
391
420
  .,.,
392
421
 
393
- module_eval(<<'.,.,', 'mvinl.y', 59)
422
+ module_eval(<<'.,.,', 'mvinl.y', 56)
394
423
  def _reduce_21(val, _values)
395
- val[0]
424
+ @context.state[:in_keyword_arg] = false
425
+ @context.state[:keyword_arg_depth] += 1
426
+ {val[0].to_sym => val[1]}
427
+
396
428
  end
397
429
  .,.,
398
430
 
399
431
  module_eval(<<'.,.,', 'mvinl.y', 62)
400
432
  def _reduce_22(val, _values)
401
- val[0].to_i
433
+ @context.state[:in_keyword_arg] = true; val[0]
402
434
  end
403
435
  .,.,
404
436
 
405
- module_eval(<<'.,.,', 'mvinl.y', 63)
437
+ module_eval(<<'.,.,', 'mvinl.y', 65)
406
438
  def _reduce_23(val, _values)
407
439
  val[0]
408
440
  end
409
441
  .,.,
410
442
 
411
- module_eval(<<'.,.,', 'mvinl.y', 64)
443
+ module_eval(<<'.,.,', 'mvinl.y', 66)
412
444
  def _reduce_24(val, _values)
413
- val[0].to_sym
445
+ val[0]
414
446
  end
415
447
  .,.,
416
448
 
417
- module_eval(<<'.,.,', 'mvinl.y', 69)
449
+ module_eval(<<'.,.,', 'mvinl.y', 67)
418
450
  def _reduce_25(val, _values)
419
- define_function(val[2], val[3], val[4])
420
-
451
+ val[0]
421
452
  end
422
453
  .,.,
423
454
 
424
- module_eval(<<'.,.,', 'mvinl.y', 73)
455
+ module_eval(<<'.,.,', 'mvinl.y', 70)
425
456
  def _reduce_26(val, _values)
426
- [val[1], *val[2]]
457
+ val[0].to_i
427
458
  end
428
459
  .,.,
429
460
 
430
- module_eval(<<'.,.,', 'mvinl.y', 74)
461
+ module_eval(<<'.,.,', 'mvinl.y', 71)
431
462
  def _reduce_27(val, _values)
432
- [val[1], *val[2]]
463
+ val[0].to_f
433
464
  end
434
465
  .,.,
435
466
 
436
- module_eval(<<'.,.,', 'mvinl.y', 77)
467
+ module_eval(<<'.,.,', 'mvinl.y', 72)
437
468
  def _reduce_28(val, _values)
438
- evaluate_pn(val[1], val[2])
469
+ val[0]
439
470
  end
440
471
  .,.,
441
472
 
442
- module_eval(<<'.,.,', 'mvinl.y', 78)
473
+ module_eval(<<'.,.,', 'mvinl.y', 73)
443
474
  def _reduce_29(val, _values)
444
- evaluate_pn(val[1], val[2])
475
+ val[0].to_sym
445
476
  end
446
477
  .,.,
447
478
 
448
- module_eval(<<'.,.,', 'mvinl.y', 81)
479
+ module_eval(<<'.,.,', 'mvinl.y', 76)
449
480
  def _reduce_30(val, _values)
450
- STATE[:depth] += 1
481
+ val[0]
451
482
  end
452
483
  .,.,
453
484
 
454
- module_eval(<<'.,.,', 'mvinl.y', 84)
485
+ module_eval(<<'.,.,', 'mvinl.y', 77)
455
486
  def _reduce_31(val, _values)
456
- STATE[:depth] -= 1
487
+ "#{val[0]} #{val[1]}"
457
488
  end
458
489
  .,.,
459
490
 
460
- module_eval(<<'.,.,', 'mvinl.y', 87)
491
+ module_eval(<<'.,.,', 'mvinl.y', 82)
461
492
  def _reduce_32(val, _values)
462
- Array.new
493
+ define_function(val[2], val[3], val[4])
494
+
463
495
  end
464
496
  .,.,
465
497
 
466
- module_eval(<<'.,.,', 'mvinl.y', 88)
498
+ module_eval(<<'.,.,', 'mvinl.y', 86)
467
499
  def _reduce_33(val, _values)
468
- val[0] << val[1]
500
+ [val[1], *val[2]]
469
501
  end
470
502
  .,.,
471
503
 
472
- module_eval(<<'.,.,', 'mvinl.y', 89)
504
+ module_eval(<<'.,.,', 'mvinl.y', 87)
473
505
  def _reduce_34(val, _values)
474
- val[0] << val[1]
506
+ [val[1], *val[2]]
475
507
  end
476
508
  .,.,
477
509
 
478
510
  module_eval(<<'.,.,', 'mvinl.y', 90)
479
511
  def _reduce_35(val, _values)
480
- val[0] << val[1]
512
+ evaluate_pn(val[1], val[2])
481
513
  end
482
514
  .,.,
483
515
 
484
- module_eval(<<'.,.,', 'mvinl.y', 93)
516
+ module_eval(<<'.,.,', 'mvinl.y', 91)
485
517
  def _reduce_36(val, _values)
486
- Array.new
518
+ evaluate_pn(val[1], val[2])
487
519
  end
488
520
  .,.,
489
521
 
490
522
  module_eval(<<'.,.,', 'mvinl.y', 94)
491
523
  def _reduce_37(val, _values)
492
- val[0] << val[1]
524
+ @context.state[:depth] += 1
493
525
  end
494
526
  .,.,
495
527
 
496
- module_eval(<<'.,.,', 'mvinl.y', 95)
528
+ module_eval(<<'.,.,', 'mvinl.y', 97)
497
529
  def _reduce_38(val, _values)
498
- val[0] << val[1]
530
+ @context.state[:depth] -= 1
499
531
  end
500
532
  .,.,
501
533
 
502
- module_eval(<<'.,.,', 'mvinl.y', 96)
534
+ module_eval(<<'.,.,', 'mvinl.y', 100)
503
535
  def _reduce_39(val, _values)
504
- val[0] << val[1]
536
+ Array.new
505
537
  end
506
538
  .,.,
507
539
 
508
- module_eval(<<'.,.,', 'mvinl.y', 99)
540
+ module_eval(<<'.,.,', 'mvinl.y', 101)
509
541
  def _reduce_40(val, _values)
542
+ val[0] << val[1]
543
+ end
544
+ .,.,
545
+
546
+ module_eval(<<'.,.,', 'mvinl.y', 102)
547
+ def _reduce_41(val, _values)
548
+ val[0] << val[1]
549
+ end
550
+ .,.,
551
+
552
+ module_eval(<<'.,.,', 'mvinl.y', 103)
553
+ def _reduce_42(val, _values)
554
+ val[0] << val[1]
555
+ end
556
+ .,.,
557
+
558
+ module_eval(<<'.,.,', 'mvinl.y', 106)
559
+ def _reduce_43(val, _values)
560
+ Array.new
561
+ end
562
+ .,.,
563
+
564
+ module_eval(<<'.,.,', 'mvinl.y', 107)
565
+ def _reduce_44(val, _values)
566
+ val[0] << val[1]
567
+ end
568
+ .,.,
569
+
570
+ module_eval(<<'.,.,', 'mvinl.y', 108)
571
+ def _reduce_45(val, _values)
572
+ val[0] << val[1]
573
+ end
574
+ .,.,
575
+
576
+ module_eval(<<'.,.,', 'mvinl.y', 109)
577
+ def _reduce_46(val, _values)
578
+ val[0] << val[1]
579
+ end
580
+ .,.,
581
+
582
+ module_eval(<<'.,.,', 'mvinl.y', 112)
583
+ def _reduce_47(val, _values)
584
+ val[0].to_sym
585
+ end
586
+ .,.,
587
+
588
+ module_eval(<<'.,.,', 'mvinl.y', 115)
589
+ def _reduce_48(val, _values)
510
590
  val[0].to_sym
511
591
  end
512
592
  .,.,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mvinl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - siery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-06 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pp
@@ -41,11 +41,14 @@ files:
41
41
  - bin/imvnl
42
42
  - edit/mvinl.vim
43
43
  - lib/mvinl.rb
44
+ - lib/mvinl/context.rb
44
45
  - lib/mvinl/info.rb
45
46
  - lib/mvinl/lexer.rb
46
47
  - lib/mvinl/parser.rb
47
48
  - mvinl.gemspec
48
49
  - rakelib/build.rake
50
+ - spec/program_spec.rb
51
+ - spec/spec_helper.rb
49
52
  - spec/stack.mvnl
50
53
  - syntax/mvinl.tab.rb
51
54
  homepage: https://rubygems.org/gems/mvinl
@@ -57,9 +60,6 @@ post_install_message:
57
60
  rdoc_options: []
58
61
  require_paths:
59
62
  - lib
60
- - bin
61
- - s
62
- - rakelib
63
63
  - syntax
64
64
  required_ruby_version: !ruby/object:Gem::Requirement
65
65
  requirements: