Feature #152

avatar

Improve shebang handling

Added by Ash Berlin 274 days ago. Updated 212 days ago.

Status:Closed Start:10/28/2009
Priority:Normal Due date:
Assigned to:avatarAsh Berlin % Done:

100%

Category:Interpreter / Shell
Target version:0.9

Description

http://code.google.com/p/gpsee/issues/detail?id=12

Talking in IRC with Wes and the problem of how to handle shebang lines, the following idea came up:

#! /usr/bin/commonjs
// gpsee: zzdd
// flussfperd: -i -Ilib
//
// This comment would be parsed by JS API
function hello()
{
  print("world");
}

And of course in that example, the print should be line 8 form JS stack traces etc.

Associated revisions

Revision 3aaf5d1fcb253873d255a1fe3f8753eb99c08e08
Added by Ash Berlin 212 days ago

modules: Parse and pull out // flusspferd: x lines (issue #152)

Revision a3d4b6863276b1195f27b12d4183c396dc23e6f2
Added by Ash Berlin 212 days ago

Store all options in module cache and detect encoding line (refs #152)

Revision eeaa684113a6d4e32856dd3a2fd644dbb82d1d4f
Added by Ash Berlin 212 days ago

option-comment to disable warnings (refs #152)

Revision becb5bac407721596ad2af064018228d00c1b2e5
Added by Ash Berlin 212 days ago

Fix bug in warnings option checking code (refs #152)

Accessing a property on a null object (in the warning reporter) caused a warning in itself -> Loop -> buh-bye stack!

Revision cf921960616259ae65db59f66ccf91488886c43b
Added by Ash Berlin 212 days ago

Fix and test when command optline processing happens (refs #152)

Revision f52e7cb976cfc0e97b4f0a3e01d86e17754b789e
Added by Ash Berlin 212 days ago

Merge branch 'shebang_152' into master (closes #152)

Merge branch 'shebang_152'

History

Updated by Aristid Breitkreuz 231 days ago

avatar
  • Tracker changed from Bug to Feature

Updated by Ash Berlin 228 days ago

avatar
  • Status changed from New to Assigned

Updated by Ash Berlin 226 days ago

avatar

While we are in here messing about with special comments, we should add support for specifying file encoding, along the same lines as PEP-0263: Defining Python Source Code Encodings but with // instead of #:

Example:

#!/usr/bin/env commonjs
// -*- coding: latin-1 -*- vim: set fileencoding=latin-1 :
// event-loop: Zest
// flusspferd: -Wno-frobinate
// gpse: --dance-like-a

Updated by Ash Berlin 212 days ago

avatar
  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:"092678dc5246b9b3d19088434db449af738a7b9a".

Also available in: Atom PDF