Class: RubyLexer::NestedContexts::DefContext
- Inherits:
-
WantsEndContext
- Object
- NestedContext
- WantsEndContext
- RubyLexer::NestedContexts::DefContext
- Defined in:
- lib/rubylexer/context.rb
Instance Attribute Summary collapse
-
#has_parens ⇒ Object
writeonly
Sets the attribute has_parens.
-
#in_body ⇒ Object
readonly
Returns the value of attribute in_body.
Attributes inherited from WantsEndContext
Attributes inherited from NestedContext
Instance Method Summary collapse
- #has_parens? ⇒ Boolean
-
#initialize(linenum) ⇒ DefContext
constructor
A new instance of DefContext.
- #see(lxr, msg) ⇒ Object
Methods inherited from NestedContext
#lhs, #lhs=, #matches?, #wantarrow
Constructor Details
#initialize(linenum) ⇒ DefContext
Returns a new instance of DefContext.
206 207 208 209 |
# File 'lib/rubylexer/context.rb', line 206 def initialize(linenum) super('def', linenum) @in_body=false end |
Instance Attribute Details
#has_parens=(value) ⇒ Object (writeonly)
Sets the attribute has_parens
222 223 224 |
# File 'lib/rubylexer/context.rb', line 222 def has_parens=(value) @has_parens = value end |
#in_body ⇒ Object (readonly)
Returns the value of attribute in_body.
220 221 222 |
# File 'lib/rubylexer/context.rb', line 220 def in_body @in_body end |
Instance Method Details
#has_parens? ⇒ Boolean
223 |
# File 'lib/rubylexer/context.rb', line 223 def has_parens?; @has_parens end |
#see(lxr, msg) ⇒ Object
211 212 213 214 215 216 217 218 |
# File 'lib/rubylexer/context.rb', line 211 def see(lxr,msg) if msg==:semi and @state!=:semi @in_body=true @state=:semi else super end end |