Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

various minor bugfixes to the expression compiler

  • Loading branch information...
commit df90bdad50d3bec02b7cc048cace9546502263f7 1 parent 483dbbc
Eric Merritt authored December 28, 2011

Showing 1 changed file with 10 additions and 8 deletions. Show diff stats Hide diff stats

  1. 18  src/jxa_expression.erl
18  src/jxa_expression.erl
@@ -147,7 +147,7 @@ comp(Path0, Ctx0, [cons, Arg1, Arg2]) ->
147 147
                                        jxa_ctx:annots(Ctx2)),
148 148
     {Ctx2, cerl:ann_c_cons(Line, Cerl1, Cerl2)};
149 149
 comp(Path0, Ctx0, [quote, Args]) ->
150  
-    Literal = jxa_literal:comp(jxa_path:incr(Path0), Ctx0, Args),
  150
+    Literal = jxa_literal:comp(jxa_path:add(jxa_path:incr(Path0)), Ctx0, Args),
151 151
     {Ctx0, Literal};
152 152
 comp(Path0, Ctx0, [list | Args]) ->
153 153
     Path1 = jxa_path:incr(Path0),
@@ -199,15 +199,17 @@ comp(Path0, Ctx0, Form = [Val | Args]) ->
199 199
                 {error, Error2 = {mismatched_arity, _, _, _, _}} ->
200 200
                     ?JXA_THROW({Error2, Idx});
201 201
                 not_a_reference ->
202  
-                    %% The last thing it might be is a function call. So we
203  
-                    %% are going to try to compile it. It might work
204  
-                    {Ctx1, Cerl} = comp(Path1, Ctx1, Val),
205  
-                    {Ctx1, cerl:ann_c_apply([BaseLine], Cerl, ArgList)}
  202
+                    ?JXA_THROW({invalid_reference, Val, PossibleArity, Idx})
206 203
             end
207 204
     end;
208  
-comp(Path0, Ctx0, _Form) ->
209  
-    {_, Idx} = jxa_annot:get(jxa_path:path(Path0), jxa_ctx:annots(Ctx0)),
210  
-    ?JXA_THROW({invalid_form, Idx}).
  205
+comp(Path0, Ctx0, Form) ->
  206
+    case jxa_annot:get(jxa_path:path(Path0), jxa_ctx:annots(Ctx0)) of
  207
+        {string, {Line, _}} ->
  208
+            {Ctx0, cerl:ann_c_string([Line], Form)};
  209
+        _ ->
  210
+            {_, Idx} = jxa_annot:get(jxa_path:path(Path0), jxa_ctx:annots(Ctx0)),
  211
+            ?JXA_THROW({invalid_form, Idx})
  212
+    end.
211 213
 
212 214
 mk_tuple(Path0, Ctx0, Args) ->
213 215
     {_, Ctx3, Body} =

0 notes on commit df90bda

Please sign in to comment.
Something went wrong with that request. Please try again.