Permalink
Browse files

Modify the constructor of IronRuby.Hpricot.ScannerState to take an is…

…tance of IronRuby.Runtime.RubyContext.
  • Loading branch information...
1 parent 4187811 commit 2ff28f97cca32258f8b4b28c8084a83e81aacb67 @nrk committed Jul 17, 2010
Showing with 9 additions and 13 deletions.
  1. +2 −2 src/HpricotScanner.cs
  2. +7 −11 src/ScannerState.cs
@@ -1494,8 +1494,8 @@ public class HpricotScanner {
throw RubyExceptions.CreateArgumentError("bad Hpricot argument, String or IO only please.");
}
- if (_blockParam == null) {
- ScannerState state = new ScannerState();
+ if (_blockParam == null) {
+ ScannerState state = new ScannerState(_currentContext);
Hpricot.Document doc = new Hpricot.Document();
state.Doc = doc;
state.Focus = state.Doc as IHpricotDataContainer;
View
@@ -1,10 +1,12 @@
using System;
+using IronRuby.Runtime;
using IronRuby.Builtins;
namespace IronRuby.Hpricot {
public class ScannerState {
#region fields
+ private RubyContext _context;
private IHpricotDataContainer _doc;
private IHpricotDataContainer _focus;
private IHpricotDataContainer _last;
@@ -15,18 +17,10 @@ public class ScannerState {
#endregion
- #region constructors
-
- public ScannerState() {
- _xml = false;
- _strict = false;
- _fixup = false;
+ public ScannerState(RubyContext context) {
+ _context = context;
}
- #endregion
-
- #region properties
-
public IHpricotDataContainer Doc {
get { return _doc; }
set { _doc = value; }
@@ -64,6 +58,8 @@ public class ScannerState {
set { _fixup = value; }
}
- #endregion
+ public RubyContext Context {
+ get { return _context; }
+ }
}
}

0 comments on commit 2ff28f9

Please sign in to comment.