mt-lang 0.3.7 → 0.3.8
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 180f49844f839480b6aed67ca33f5aef4532cb0a372dce913699b892fc85c4b1
|
|
4
|
+
data.tar.gz: f99ec00f1749c5142694ff93211a9745cc1cbd0c53e7a1b311125a53aafedfd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8874f3444b514ac33d33949a01d438a5de17139443e618ba2fc282a47fefc9138df686493eb368b116802750a03b844535f881a2ba48c3fae8fbcfbb4062b608
|
|
7
|
+
data.tar.gz: 0172adf373b345e1b3d40f79c4c0f3e05e2da088053af78b582f258cff87312dd2bac29ba2434bafab09630e13455c7f75ea32cb33a517694206e46a4f2ce95e
|
data/lib/milk_tea/base.rb
CHANGED
|
@@ -137,7 +137,12 @@ module MilkTea
|
|
|
137
137
|
@graph.add_edge(match_id, next_id)
|
|
138
138
|
else
|
|
139
139
|
stmt.arms.each do |arm|
|
|
140
|
-
|
|
140
|
+
arm_body = if arm.respond_to?(:body)
|
|
141
|
+
arm.body
|
|
142
|
+
else
|
|
143
|
+
[MilkTea::AST::ExpressionStmt.new(expression: arm.value, line: arm.value.respond_to?(:line) ? arm.value.line : nil)]
|
|
144
|
+
end
|
|
145
|
+
arm_entry = build_block(arm_body, next_id, break_target:, continue_target:)
|
|
141
146
|
if arm.binding_name
|
|
142
147
|
binding_key = declaration_binding_key(arm, arm.binding_name)
|
|
143
148
|
if binding_key
|
|
@@ -204,7 +204,11 @@ module MilkTea
|
|
|
204
204
|
lines.concat(statement_list_lines(statement.body))
|
|
205
205
|
when AST::MatchStmt
|
|
206
206
|
statement.arms.each do |arm|
|
|
207
|
-
|
|
207
|
+
if arm.respond_to?(:body)
|
|
208
|
+
lines.concat(statement_list_lines(arm.body))
|
|
209
|
+
else
|
|
210
|
+
lines << expression_end_line(arm.value)
|
|
211
|
+
end
|
|
208
212
|
end
|
|
209
213
|
when AST::DeferStmt
|
|
210
214
|
lines.concat(statement_list_lines(statement.body)) if statement.body
|
|
@@ -374,7 +378,13 @@ module MilkTea
|
|
|
374
378
|
when AST::WhileStmt, AST::ForStmt, AST::UnsafeStmt, AST::ErrorBlockStmt
|
|
375
379
|
[stmt.respond_to?(:line) ? stmt.line : nil, last_ast_line(stmt.body)].compact.max
|
|
376
380
|
when AST::MatchStmt
|
|
377
|
-
arm_lines = stmt.arms.filter_map
|
|
381
|
+
arm_lines = stmt.arms.filter_map do |arm|
|
|
382
|
+
if arm.respond_to?(:body)
|
|
383
|
+
last_ast_line(arm.body)
|
|
384
|
+
elsif arm.respond_to?(:value)
|
|
385
|
+
arm.value.respond_to?(:line) ? arm.value.line : nil
|
|
386
|
+
end
|
|
387
|
+
end
|
|
378
388
|
[stmt.line, *arm_lines].compact.max
|
|
379
389
|
when AST::DeferStmt
|
|
380
390
|
[stmt.respond_to?(:line) ? stmt.line : nil, last_ast_line(stmt.body)].compact.max
|
|
@@ -376,7 +376,11 @@ module MilkTea
|
|
|
376
376
|
else
|
|
377
377
|
callee_name = expression.callee.callee.is_a?(AST::Identifier) ? expression.callee.callee.name : nil
|
|
378
378
|
if callee_name
|
|
379
|
-
resolved_type =
|
|
379
|
+
resolved_type = begin
|
|
380
|
+
resolve_type_expression(expression.callee)
|
|
381
|
+
rescue SemanticError
|
|
382
|
+
nil
|
|
383
|
+
end
|
|
380
384
|
if resolved_type && resolved_type.is_a?(Types::Struct)
|
|
381
385
|
fields = {}
|
|
382
386
|
expression.arguments.each do |argument|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mt-lang
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Long (Teefan) Tran
|
|
@@ -603,7 +603,7 @@ metadata:
|
|
|
603
603
|
homepage_uri: https://teefan.github.io/mt-lang/
|
|
604
604
|
source_code_uri: https://github.com/teefan/mt-lang
|
|
605
605
|
post_install_message: |
|
|
606
|
-
Milk Tea 0.3.
|
|
606
|
+
Milk Tea 0.3.8 installed!
|
|
607
607
|
|
|
608
608
|
System requirements:
|
|
609
609
|
- A C compiler (gcc or clang) must be available on PATH
|