Skip to content

Commit

Permalink
Simple changes that I need to get out of the way. Cleanup only.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/cocor/dev/": change = 1328]
  • Loading branch information
zenspider committed Oct 29, 2003
1 parent 5833b63 commit 78f19a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@

RUBY=BitSet.rb Comp.rb DFA.rb ParserGen.rb Sets.rb Tab.rb Trace.rb module-hack.rb
RUBY=ruby
RUBYFLAGS=-w
RUBYFILES=BitSet.rb Comp.rb DFA.rb ParserGen.rb Sets.rb Tab.rb Trace.rb module-hack.rb
FRAMES=Parser.frame Scanner.frame

.FORCE: all
all:
rm -rf build build2
mkdir build
cp $(RUBY) $(FRAMES) Coco.ATG build
ruby -w Comp.rb build/Coco.ATG
(cd build; ruby -cw *.rb)
cp $(RUBYFILES) $(FRAMES) Coco.ATG build
$(RUBY) $(RUBYFLAGS) Comp.rb build/Coco.ATG
(cd build; $(RUBY) $(RUBYFLAGS) -c *.rb)
mkdir build/build2
cp $(RUBY) $(FRAMES) Coco.ATG build/build2
(cd build; ruby -w Comp.rb build2/Coco.ATG)
cp $(RUBYFILES) $(FRAMES) Coco.ATG build/build2
(cd build; $(RUBY) $(RUBYFLAGS) Comp.rb build2/Coco.ATG)
mv build/build2 .
diff build/listing build2/listing
-diff build/listing build2/listing
diff -r build build2

bootstrap: all
Expand All @@ -40,10 +42,10 @@ rollback:
mv ErrorStream.rb.prev ErrorStream.rb

profile:
ruby -w -rprofile Comp.rb build/Coco.ATG
$(RUBY) $(RUBYFLAGS) -rprofile Comp.rb build/Coco.ATG

occur:
ruby -w Comp.rb build/Coco.ATG 2>&1 | occur
$(RUBY) $(RUBYFLAGS) Comp.rb build/Coco.ATG 2>&1 | occur

clean:
rm -rf build build2 *.prev *~
Expand Down
14 changes: 5 additions & 9 deletions Sets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
class Sets

def Sets.Empty(s)
return true if s == 0
raise "um... you passed a FixNum" if s.kind_of? Fixnum
s.each do |x|
return false if (x)
return false if x
end
return true
end
Expand All @@ -27,6 +27,9 @@ def Sets.Includes(s1, s2)
end

def Sets.FullSet(max)
warn_usage if $DEBUG

# TODO: this is dumb: return BitSet.new(max, true)
s = BitSet.new
for i in 0..max
s.set(i)
Expand All @@ -36,13 +39,6 @@ def Sets.FullSet(max)

def Sets.Size(s)
return s.trueCount

# size = 0
# max = s.size
# for i in 0..(max-1)
# size += 1 if (s[i])
# end
# return size
end

def Sets.First(s)
Expand Down

0 comments on commit 78f19a0

Please sign in to comment.