All pastes #2121616 Raw Edit

Miscellany

public text v1 · immutable
#2121616 ·published 2012-02-26 04:29 UTC
rendered paste body
# Tabs vs. Spaces in CoffeeScript v1.2.0
#
# This file contains both TABS and SPACES - that's the whole point!
# Copy/Paste carefully.

# Test 1:
ok_in_this_order:
  spaces_on_this_line: 2
	tabs_on_this_line: 1

# Test 2:
confuses_parser_in_this_order:
	tabs_on_this_line: 1
  spaces_on_this_line: 2

# Test 2 yields the confusing message on compilation:
#  Parse error on line 7: Unexpected '{'

# Error: In test.coffee, Parse error on line 7: Unexpected '{'
#     at Object.parseError (/opt/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:470:11)
#     at Object.parse (/opt/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:546:22)
#     at Object.compile (/opt/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:40:22)
#     at /opt/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:140:33
#     at /opt/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:110:18
#     at [object Object].<anonymous> (fs.js:115:5)
#     at [object Object].emit (events.js:64:17)
#     at afterRead (fs.js:1112:12)
#     at Object.wrapper [as oncomplete] (fs.js:254:17)