#Iamacomment.Justignoreme.#Youcancommentmultiplelinesasfollows:#Thisisacomment.#Thisisacomment,too.#Thisisacomment,too.#Isaidthatalready.#Hereisanotherform.Thisblockcommentconcealsseverallinesfromthe#interpreterwith=begin/=end:=begin__FILE__anddefendinorselfunlessaliasclassThisisacomment.Thisisacomment,too.Thisisacomment,too.Notagain.=end#ThesyntaxofaRubymethodisasfollows:
defMethodName1(arg1,arg2,arg3,...)#..rubycode..returnvalueenddefMethodName2(arg1,arg2,arg3,...)#..rubycode..returnvalueenddefMethodName3(arg1,arg2,arg3,...)#..rubycode..returnvalueenddefMethodName4(arg1,arg2,arg3,...)#..rubycode..returnvalueenddefmultiply(val1,val2)result=val1*val2returnresultendaliasdocalcmultiply#linecommentclassClassNamedefClassMethodName@@classVariable=0.2#classvariableenddefGetterMethodName#gettermethod@instanceVariable="12345"#instancevariableenddefSetterMethodName=(value)#settermethod@instanceVariable=valueenddefinitialize()enddefInstanceMethodName(argument)#instancemethodputsargument*classVariableenddefInstanceMethodName_NoArgs#methodputs"The class is working"putsinstanceVariableendendclassSubClassName<SuperClassName#classinheritancedefSetterMethodName@instanceVariableenddefGetterMethodName=(value)@instanceVariable=valueendend#Declarescodetobecalledattheendoftheprogram.END{puts"Terminating Ruby Program"}#Declarescodetobecalledbeforetheprogramisrun.BEGIN{puts"Initializing Ruby Program"}#{name}#" text "text" # { name } # "text" text "classPersonattr_reader :name,:agedefinitialize(name,age)@name,@age=name,ageend#"the comparison "operatorforsorting" def <=>(person) age <=> person.age end def <=>(person) # "thecomparison"operator for sorting"age<=>person.ageenddefto_s#thenextlineshouldnotbeinterpretedascomment!"#{name} (#{age})"endend#shouldmatchdef::(arg)#statementsenddef[](arg)#statementsenddef[]=(arg)#statementsenddef**(arg)#statementsenddef!(arg)#statementsenddef~(arg)#statementsenddef+(arg)#statementsenddef-(arg)#statementsenddef*(arg)#statementsenddef/(arg)#statementsenddef%(arg)#statementsenddef>>(arg)#statementsenddef<<(arg)#statementsenddef&(arg)#statementsenddef^(arg)#statementsenddef|(arg)#statementsenddef<=(arg)#statementsenddef<(arg)#statementsenddef>(arg)#statementsenddef>=(arg)#statementsenddef<=>(arg)#statementsenddef==(arg)#statementsenddef===(arg)#statementsenddef!=(arg)#statementsenddef=~(arg)#statementsenddef!~(arg)#statementsend#shouldNOTmatchdef=<(arg)#statementsenddef=>(arg)#statementsenddef>>>(arg)#statementsenddef<>(arg)#statementsenddef<<>(arg)#statementsend=beginThefollowingwordsarereservedinRuby:
__FILE__anddefendinorselfunless__LINE__begindefined?ensuremoduleredosuperuntilBEGINbreakdofalsenextrescuethenwhenENDcaseelsefornilretrytruewhilealiasclasselsififnotreturnundefyield=end
Regards, Menno
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I verified on 6.7.4. Since I patched SciLexer.cpp in order to Fold multiline comments, somehow this change makes FunctionList regular expression to fail.
My take on the Ruby parser:
TODO:
The parser test file:
Regards, Menno
hi,
I modified my functionlist.xml as you described, somehow I am still not able to get it working.
I have attached my functionlist.xml
Notepad++ Je suis Charile edition
The latest edition (tested with Notepad++ 6.7.3):
Great,
Thanks for the update. I tested on Notepad 6.7.3 and It works fine, however testing with Notepad 6.7.4 just shows nothing.
Any clue what do I need to change to make it work on 6.7.4?
Thanks
Hi,
I verified on 6.7.4. Since I patched SciLexer.cpp in order to Fold multiline comments, somehow this change makes FunctionList regular expression to fail.
Here additional information:
https://sourceforge.net/p/notepad-plus/feature-requests/2032/?limit=25#7071
Thans for your support