lib/rbs/parser.y in rbs-0.13.1 vs lib/rbs/parser.y in rbs-0.14.0
- old
+ new
@@ -1,7 +1,8 @@
class RBS::Parser
- token tUIDENT tLIDENT tNAMESPACE tINTERFACEIDENT tLKEYWORD tUKEYWORD tGLOBALIDENT
+ token tUIDENT tLIDENT tNAMESPACE tINTERFACEIDENT tGLOBALIDENT
+ tLKEYWORD tUKEYWORD tLKEYWORD_Q_E tUKEYWORD_Q_E
tIVAR tCLASSVAR
tANNOTATION
tSTRING tSYMBOL tINTEGER tWRITE_ATTR
kLPAREN kRPAREN kLBRACKET kRBRACKET kLBRACE kRBRACE
kVOID kNIL kTRUE kFALSE kANY kUNTYPED kTOP kBOT kSELF kSELFQ kINSTANCE kCLASS kBOOL kSINGLETON kTYPE kDEF kMODULE
@@ -844,11 +845,11 @@
keyword
| identifier_keywords kCOLON {
result = val[0]
}
- keyword: tLKEYWORD | tUKEYWORD
+ keyword: tLKEYWORD | tUKEYWORD | tLKEYWORD_Q_E | tUKEYWORD_Q_E
function_type:
kLPAREN params kRPAREN kARROW simple_type {
location = val[0].location + val[4].location
type = Types::Function.new(
@@ -1342,11 +1343,15 @@
new_token(PUNCTS[input.matched])
when input.scan(/(::)?([A-Z]\w*::)+/)
new_token(:tNAMESPACE)
when input.scan(/[a-z_]\w*:/)
new_token(:tLKEYWORD, input.matched.chop.to_sym)
+ when input.scan(/[a-z_]\w*[?!]:/)
+ new_token(:tLKEYWORD_Q_E, input.matched.chop.to_sym)
when input.scan(/[A-Z]\w*:/)
new_token(:tUKEYWORD, input.matched.chop.to_sym)
+ when input.scan(/[A-Z]\w*[?!]:/)
+ new_token(:tUKEYWORD_Q_E, input.matched.chop.to_sym)
when input.scan(/\$[A-Za-z_]\w*/)
new_token(:tGLOBALIDENT)
when input.scan(/@[a-zA-Z_]\w*/)
new_token(:tIVAR, input.matched.to_sym)
when input.scan(/@@[a-zA-Z_]\w*/)