fcshd 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
data/bin/fcshc CHANGED
@@ -88,7 +88,7 @@ EOF
88
88
  $run_compilation = true
89
89
  if FCSHD::FlexHome.known?
90
90
  $extra_arguments << "-theme=#{FCSHD::FlexHome.halo_swc}"
91
- else
91
+ else
92
92
  die "must set $FLEX_HOME to use --halo option"
93
93
  end
94
94
  end
@@ -141,8 +141,7 @@ for name in ARGV
141
141
  end
142
142
  end
143
143
 
144
- ENV["FCSHD_LIBRARY_PATH"] ||= ""
145
- ENV["FCSHD_LIBRARY_PATH"] += ":~/.fcshd-lib"
144
+ ENV["FCSHD_LIBRARY_PATH"] ||= "~/.fcshd-lib"
146
145
 
147
146
  def find_library(name)
148
147
  nil.tap do
@@ -174,22 +173,22 @@ end
174
173
 
175
174
  if $run_compilation
176
175
  $compiling_swc = $output_file && $output_file.end_with?(".swc")
177
-
176
+
178
177
  if $compiling_swc
179
178
  if [$source_files, $directories, $library_files] == [[], [], []]
180
179
  die "must include at least one source file, directory, or SWC"
181
180
  end
182
-
181
+
183
182
  $compilation_command = ["compc"]
184
-
183
+
185
184
  for file in $source_files
186
185
  $compilation_command << "-include-sources+=#{file}"
187
186
  end
188
-
187
+
189
188
  for directory in $directories
190
189
  $compilation_command << "-include-sources+=#{directory}"
191
190
  end
192
-
191
+
193
192
  if FCSHD::FlexHome.known?
194
193
  for dir in FCSHD::FlexHome.framework_lib_dirs
195
194
  $extra_arguments << "-external-library-path+=#{dir}"
@@ -204,31 +203,31 @@ if $run_compilation
204
203
  else
205
204
  die "multiple source files not allowed when compiling SWF"
206
205
  end
207
-
206
+
208
207
  if $directories.empty?
209
208
  $directories << File.dirname($source_file)
210
209
  end
211
-
210
+
212
211
  if $output_file == nil
213
212
  $source_file.sub(/\.(as|mxml)$/, ".swf").tap do |x|
214
213
  $output_file = File.expand_path(File.basename(x))
215
214
  end
216
215
  end
217
-
216
+
218
217
  $compilation_command = ["mxmlc", "#$source_file"]
219
218
  end
220
-
219
+
221
220
  $compilation_command << "-output=#$output_file"
222
-
221
+
223
222
  for directory in $directories
224
223
  $compilation_command << "-compiler.source-path+=#{directory}"
225
224
  $compilation_command << "-compiler.library-path+=#{directory}"
226
225
  end
227
-
226
+
228
227
  for file in $library_files
229
228
  $compilation_command << "-compiler.library-path+=#{file}"
230
229
  end
231
-
230
+
232
231
  $compilation_command.concat($extra_arguments)
233
232
  end
234
233
 
@@ -64,7 +64,7 @@ module FCSHD
64
64
  rescue FCSHError => error
65
65
  case error.message
66
66
  when "Error: null"
67
- @frontend.puts "fcshd: Adobe-internal error; restarting fcsh..."
67
+ @frontend.puts "fcshd: got mysterious error; restarting fcsh..."
68
68
  restart_fcsh_process!
69
69
  @frontend.puts "fcshd: retrying your compilation"
70
70
  compile_new!
@@ -1,3 +1,5 @@
1
+ require "pathname"
2
+
1
3
  module FCSHD
2
4
  class SourceLocation < Struct.new(:filename, :line_number)
3
5
  def to_s(basedir=nil)
@@ -5,11 +7,7 @@ module FCSHD
5
7
  end
6
8
 
7
9
  def relative_filename(basedir)
8
- if basedir
9
- filename.sub(/^#{Regexp.quote(basedir)}/, "")
10
- else
11
- filename
12
- end
10
+ Pathname.new(filename).relative_path_from(Pathname.new(basedir))
13
11
  end
14
12
  end
15
13
  end
@@ -53,6 +53,9 @@ error: hint: xmlns="http://www.adobe.com/2006/mxml" (Flex 3)
53
53
  EOF
54
54
  when /^Incorrect number of arguments. Expected (\d+)\.$/ then <<EOF
55
55
  error: expected #$1 arguments
56
+ EOF
57
+ when /^Incorrect number of arguments. Expected no more than (\d+)\.$/ then <<EOF
58
+ error: expected at most #$1 arguments
56
59
  EOF
57
60
  when
58
61
  /^Access of possibly undefined property (.+) through a reference with static type (.+)\.$/,
@@ -118,15 +121,22 @@ EOF
118
121
  error: #{quote $1} conflicts with an internal name
119
122
  EOF
120
123
  when
121
- /^Warning: parameter '(.+)' has no type declaration\.$/,
122
124
  /^Warning: return value for function '(.+)' has no type declaration\.$/
123
125
  then
124
- who = $1 == "anonymous" ? "anonymous function" : quote($1)
125
126
  <<EOF
126
- error: #{who} missing type declaration
127
+ error: #{quote($1) + " " unless $1 == "anonymous"}missing return type
128
+ EOF
129
+ when
130
+ /^Warning: parameter '(.+)' has no type declaration\.$/
131
+ then
132
+ <<EOF
133
+ error: #{quote($1)} missing type
127
134
  EOF
128
135
  when /^A file found in a source-path must have the same package structure '(.*)', as the definition's package, '(.*)'\.$/ then <<EOF
129
136
  error: package should be #{quote $1}
137
+ EOF
138
+ when /^A file found in a source-path '(.*)' must have the same name as the class definition inside the file '(.*)'\.$/ then <<EOF
139
+ error: name should be #{quote $1}
130
140
  EOF
131
141
  when /^Comparison between a value with static type (.+) and a possibly unrelated type (.+)\.$/ then <<EOF
132
142
  error: comparing #$1 to #$2
@@ -142,9 +152,6 @@ error: setter must return void"
142
152
  EOF
143
153
  when "Function does not return a value." then <<EOF
144
154
  error: missing return statement"
145
- EOF
146
- when "Syntax error: expecting identifier before rightparen." then <<EOF
147
- error: #{quote ")"} unexpected"
148
155
  EOF
149
156
  when
150
157
  /^The (.+) attribute can only be used inside a package\./,
@@ -152,13 +159,39 @@ EOF
152
159
  then
153
160
  <<EOF
154
161
  error: #{quote $1} unexpected
162
+ EOF
163
+ when /^Syntax error: expecting (.+?) before (.+?)\.$/
164
+ <<EOF
165
+ error: missing #{lexeme($1)} (found #{lexeme($2)} instead)
166
+ EOF
167
+
168
+ when "Syntax error: XML does not have matching begin and end tags."
169
+ <<EOF
170
+ error: XML tag mismatch
155
171
  EOF
156
172
  else
157
173
  mxmlc_message
158
174
  end
159
175
  end
160
176
 
177
+ def name(string) string.sub!(":", ".") end
161
178
  def quote(string) "‘#{string}’" end
162
- def name(string) string.sub! ":", "." end
179
+
180
+ def lexeme(name)
181
+ parse_line = lambda { |line| line.chomp.split(/\s*\|\s*/, 2) }
182
+ Hash[<<EOF.lines.map(&parse_line)][name] || quote(name)
183
+ colon | ‘:’
184
+ semicolon | ‘;’
185
+ leftparen | ‘(’
186
+ rightparen | ‘)’
187
+ leftbracket | ‘[’
188
+ rightbracket | ‘]’
189
+ leftbrace | ‘{’
190
+ rightbrace | ‘}’
191
+ xmltagstartend | ‘</>’
192
+ identifier | expression
193
+ end of program | eof
194
+ EOF
195
+ end
163
196
  end
164
197
  end
@@ -24,10 +24,12 @@ module FCSHD
24
24
 
25
25
  when /^(\/.+?)(?:\((\d+)\))?: (?:col: \d+ )?(.+)$/
26
26
  result << Transcript::Item[SourceLocation[$1, $2.to_i], $3]
27
- skip_indented_lines! # Ignore the "diagram" of the problem.
27
+ skip_problem_diagram!
28
+ skip_indented_lines!
28
29
 
29
30
  when /^Required RSLs:$/
30
- skip_indented_lines! # Does anybody care about this?
31
+ # Does anybody care about this?
32
+ skip_indented_lines!
31
33
 
32
34
  when /^(Recompile|Reason|Updated): /
33
35
  when /^Loading configuration file /
@@ -59,6 +61,10 @@ module FCSHD
59
61
  lines.first.chomp
60
62
  end
61
63
 
64
+ def skip_problem_diagram!
65
+ lines.shift(4) if lines[0...4].grep /^\s*\^\s*$/
66
+ end
67
+
62
68
  def skip_indented_lines!
63
69
  skip_line! until lines.empty? or current_line =~ /^\S/
64
70
  end
data/lib/fcshd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  unless defined? FCSHD::VERSION
2
2
  module FCSHD
3
- VERSION = "0.6.4"
3
+ VERSION = "0.6.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fcshd
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 13
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 6
8
- - 4
9
- version: 0.6.4
9
+ - 5
10
+ version: 0.6.5
10
11
  platform: ruby
11
12
  authors:
12
13
  - Daniel Brockman
@@ -14,8 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2012-02-07 00:00:00 +01:00
18
- default_executable:
18
+ date: 2012-03-09 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: |
@@ -55,7 +55,6 @@ files:
55
55
  - lib/fcshd/transcript-parser.rb
56
56
  - lib/fcshd/transcript.rb
57
57
  - lib/fcshd/version.rb
58
- has_rdoc: true
59
58
  homepage: http://github.com/dbrock/fcshd
60
59
  licenses: []
61
60
 
@@ -65,23 +64,27 @@ rdoc_options: []
65
64
  require_paths:
66
65
  - lib
67
66
  required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
68
  requirements:
69
69
  - - ">="
70
70
  - !ruby/object:Gem::Version
71
+ hash: 3
71
72
  segments:
72
73
  - 0
73
74
  version: "0"
74
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
75
77
  requirements:
76
78
  - - ">="
77
79
  - !ruby/object:Gem::Version
80
+ hash: 3
78
81
  segments:
79
82
  - 0
80
83
  version: "0"
81
84
  requirements: []
82
85
 
83
86
  rubyforge_project:
84
- rubygems_version: 1.3.6
87
+ rubygems_version: 1.8.15
85
88
  signing_key:
86
89
  specification_version: 3
87
90
  summary: Usable CLI for the Adobe Flex compiler shell (fcsh)