Browse Source

[parser] disallow expression keywords as lambda argument names

closes #7175
Simon Krajewski 7 years ago
parent
commit
b60d0b00e1
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/syntax/grammar.mly

+ 2 - 0
src/syntax/grammar.mly

@@ -1057,6 +1057,8 @@ and arrow_ident_checktype e = (match e with
 
 
 and arrow_first_param e =
 and arrow_first_param e =
 	(match fst e with
 	(match fst e with
+	| EConst(Ident ("true" | "false" | "null" | "this" | "super")) ->
+		error (Custom "Invalid argument name") (pos e)
 	| EConst(Ident n) ->
 	| EConst(Ident n) ->
 		(n,snd e),false,[],None,None
 		(n,snd e),false,[],None,None
 	| EBinop(OpAssign,e1,e2)
 	| EBinop(OpAssign,e1,e2)