Class: RedSnow::ParseResult
- Inherits:
-
Object
- Object
- RedSnow::ParseResult
- Defined in:
- lib/redsnow/parseresult.rb
Overview
Parse Result
Constant Summary
- VERSION_KEY =
Version key
:_version
- SUPPORTED_VERSIONS =
Supported version of Api Blueprint
["2.0"]
Instance Attribute Summary (collapse)
-
- (Object) ast
Returns the value of attribute ast.
-
- (Object) error
Returns the value of attribute error.
-
- (Object) warnings
Returns the value of attribute warnings.
Instance Method Summary (collapse)
-
- (ParseResult) initialize(result_handle)
constructor
A new instance of ParseResult.
Constructor Details
- (ParseResult) initialize(result_handle)
Returns a new instance of ParseResult
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/redsnow/parseresult.rb', line 19 def initialize(result_handle) warnings = RedSnow::Binding.sc_warnings_handler(result_handle) warningsSize = RedSnow::Binding.sc_warnings_size(warnings) @warnings = Array.new for index in 0..(warningsSize - 1) do sc_warning_handler = RedSnow::Binding.sc_warning_handler(warnings, index) warning = Hash.new warning[:message] = RedSnow::Binding.(sc_warning_handler) warning[:code] = RedSnow::Binding.sc_warning_code(sc_warning_handler) warning[:ok] = RedSnow::Binding.sc_warning_ok(sc_warning_handler) sc_location_handler = RedSnow::Binding.sc_location_handler(sc_warning_handler) sc_location_size = RedSnow::Binding.sc_location_size(sc_location_handler) warning[:location] = Array.new if sc_location_size > 0 for index in 0..(sc_location_size - 1) location = Location.new(sc_location_handler, index) warning[:location] << location end end @warnings << warning end error_handler = RedSnow::Binding.sc_error_handler(result_handle) @error = Hash.new @error[:message] = RedSnow::Binding.(error_handler) @error[:code] = RedSnow::Binding.sc_error_code(error_handler) @error[:ok] = RedSnow::Binding.sc_error_ok(error_handler) sc_location_handler = RedSnow::Binding.sc_location_handler(error_handler) sc_location_size = RedSnow::Binding.sc_location_size(sc_location_handler) @error[:location] = Array.new if sc_location_size > 0 for index in 0..(sc_location_size - 1) do location = Location.new(sc_location_handler, index) @error[:location] << location end end end |
Instance Attribute Details
- (Object) ast
Returns the value of attribute ast
9 10 11 |
# File 'lib/redsnow/parseresult.rb', line 9 def ast @ast end |
- (Object) error
Returns the value of attribute error
10 11 12 |
# File 'lib/redsnow/parseresult.rb', line 10 def error @error end |
- (Object) warnings
Returns the value of attribute warnings
11 12 13 |
# File 'lib/redsnow/parseresult.rb', line 11 def warnings @warnings end |