   value: match and match[1]
   @tag_parameters() if value and value.match(CODE)
   value ||= @chunk.substr(0, 1)
-  tag: if value.match(ASSIGNMENT) then 'ASSIGN' else value
+  tag: value
+  if value.match(ASSIGNMENT)
+    tag: 'ASSIGN'
+    throw new Error('SyntaxError: Reserved word "' + @value() + '" on line ' + @line + ' can\'t be assigned') if JS_FORBIDDEN.indexOf(@value()) >= 0
   tag: 'TERMINATOR' if value == ';'
 
   prev: @tokens[@tokens.length - 1]


# Constants ============================================================

# The list of keywords passed verbatim to the parser.
KEYWORDS: [
  "if", "else", "then", "unless",
  "true", "false", "yes", "no", "on", "off",
  "and", "or", "is", "isnt", "not",
  "new", "return",
  "try", "catch", "finally", "throw",
  "break", "continue",
  "for", "in", "of", "by", "where", "while",
  "delete", "instanceof", "typeof",
  "switch", "when",
  "super", "extends"
]

# The list of keywords that are reserved by JavaScript, but not used, and aren't
# used by CoffeeScript. Using these will throw an error at compile time.

  "case", "default", "do", "function", "var", "void", "with", "class"
  "const", "let", "debugger", "enum", "export", "import", "native"
]

# JavaScript keywords and reserved words together, excluding CoffeeScript ones.
JS_FORBIDDEN: JS_KEYWORDS.concat RESERVED

# Token matching regexes. (keep the IDENTIFIER regex in sync with AssignNode.)
IDENTIFIER : /^([a-zA-Z$_](\w|\$)*)/
