spitewaste 0.1.006 → 0.1.011

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module Spitewaste
11
11
  INSTRUCTIONS = /(\S+):|(\b(#{OPERATORS_M2T.keys * ?|})\s+(-?\d\S*)?)/
12
12
  SPECIAL_INSN = /(call|jump|jz|jn)\s+(\S+)/
13
13
 
14
- attr_reader :src, :instructions, :error
14
+ attr_reader :src, :instructions, :error, :symbol_table
15
15
 
16
16
  def initialize program, **options
17
17
  @src = program.dup
@@ -61,10 +61,10 @@ module Spitewaste
61
61
  resolve_imports
62
62
  seed_prng if @seen.include? 'random'
63
63
  resolve_strings
64
- remove_comments
65
64
  add_sugar
66
- fucktionalize
65
+ remove_comments
67
66
  propagate_macros
67
+ fucktionalize
68
68
  end
69
69
 
70
70
  def resolve_imports
@@ -160,7 +160,7 @@ module Spitewaste
160
160
  subroutines = {}
161
161
  while label = tokens.shift
162
162
  sublen = tokens.index { |t| t[/:$/] } || tokens.size
163
- subroutines[label.chop] = tokens.shift sublen
163
+ subroutines[label.chop] ||= tokens.shift sublen
164
164
  end
165
165
 
166
166
  # A subroutine may indirectly depend on the one immediately after by
@@ -1,3 +1,3 @@
1
1
  module Spitewaste
2
- VERSION = '0.1.006'
2
+ VERSION = '0.1.011'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spitewaste
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.006
4
+ version: 0.1.011
5
5
  platform: ruby
6
6
  authors:
7
7
  - Collided Scope (collidedscope)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -110,6 +110,7 @@ files:
110
110
  - lib/spitewaste/libspw/stack.spw
111
111
  - lib/spitewaste/libspw/string.spw
112
112
  - lib/spitewaste/libspw/syntax.spw
113
+ - lib/spitewaste/libspw/terminal.spw
113
114
  - lib/spitewaste/libspw/test.spw
114
115
  - lib/spitewaste/libspw/util.spw
115
116
  - lib/spitewaste/parsers/assembly.rb