lib/rbs/parser.y in rbs-1.3.0 vs lib/rbs/parser.y in rbs-1.3.1
- old
+ new
@@ -10,11 +10,11 @@
kCOLON kCOLON2 kCOMMA kBAR kAMP kHAT kARROW kQUESTION kEXCLAMATION kSTAR kSTAR2 kFATARROW kEQ kDOT kDOT3 kLT
kINTERFACE kEND kINCLUDE kEXTEND kATTRREADER kATTRWRITER kATTRACCESSOR tOPERATOR tQUOTEDMETHOD tQUOTEDIDENT
kPREPEND kEXTENSION kINCOMPATIBLE
type_TYPE type_SIGNATURE type_METHODTYPE tEOF
kOUT kIN kUNCHECKED kOVERLOAD
- kUNDERSCORE
+ tPARAMNAME
prechigh
nonassoc kQUESTION
left kAMP
left kBAR
@@ -1325,11 +1325,11 @@
location: loc
)
}
var_name_opt:
- | tLIDENT | tINTERFACEIDENT | tQUOTEDIDENT | tUNDERSCOREIDENT | kUNDERSCORE
+ | tLIDENT | tINTERFACEIDENT | tQUOTEDIDENT | tUNDERSCOREIDENT | tPARAMNAME
qualified_name:
namespace simple_name {
namespace = val[0]&.value || Namespace.empty
name = val[1].value.to_sym
@@ -1720,11 +1720,11 @@
new_token(:tUIDENT)
when input.scan(/[a-z]\w*\b/)
new_token(:tLIDENT)
when input.scan(/_[a-z]\w*\b/)
new_token(:tUNDERSCOREIDENT)
- when input.scan(/_/)
- new_token(:kUNDERSCORE)
+ when input.scan(/_[\w_]*\b/)
+ new_token(:tPARAMNAME)
when input.scan(/"(\\"|[^"])*"/)
s = input.matched.yield_self {|s| s[1, s.length - 2] }
.gsub(DBL_QUOTE_STR_ESCAPE_SEQUENCES_RE) do |match|
case match
when '\\a' then "\a"