Skip to content
This repository

parse number literals #40

Open
wants to merge 2 commits into from

1 participant

Mathias Panzenböck
Mathias Panzenböck
panzi commented May 11, 2011

This should fix parsing of number literals. Without this the decimal places where always cut. I'm not sure if I do it right, though.

Also I added an empty .gemtest to the root folder, because rake gem would not run otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
0  .gemtest
No changes.
2  ext/spidermonkey/immutable_node.c.erb
@@ -271,7 +271,7 @@ static VALUE data_pn_dval(VALUE self) {
271 271
   ImmutableNodeContext * ctx;
272 272
 
273 273
   Data_Get_Struct(self, ImmutableNodeContext, ctx);
274  
-  if(JSVAL_IS_NUMBER(ATOM_KEY(ctx->node->pn_atom))) {
  274
+  if(ctx->node->pn_type == TOK_NUMBER) {
275 275
     return rb_float_new(ctx->node->pn_dval);
276 276
   } else {
277 277
     return INT2NUM((long)(ctx->node->pn_dval));
120  johnson.gemspec
... ...
@@ -0,0 +1,120 @@
  1
+--- !ruby/object:Gem::Specification 
  2
+name: johnson
  3
+version: !ruby/object:Gem::Version 
  4
+  hash: 31
  5
+  segments: 
  6
+  - 1
  7
+  - 2
  8
+  - 0
  9
+  version: 1.2.0
  10
+platform: ruby
  11
+authors: 
  12
+- John Barnette
  13
+- Aaron Patterson
  14
+- Yehuda Katz
  15
+- Matthew Draper
  16
+autorequire: 
  17
+bindir: bin
  18
+cert_chain: []
  19
+
  20
+date: !timestamp 
  21
+  at: "2010-01-25 09:00:00 +01:00"
  22
+  "@marshal_with_utc_coercion": false
  23
+default_executable: 
  24
+dependencies: 
  25
+- !ruby/object:Gem::Dependency 
  26
+  name: gemcutter
  27
+  requirement: &id001 !ruby/object:Gem::Requirement 
  28
+    requirements: 
  29
+    - - ">="
  30
+      - !ruby/object:Gem::Version 
  31
+        hash: 21
  32
+        segments: 
  33
+        - 0
  34
+        - 2
  35
+        - 1
  36
+        version: 0.2.1
  37
+  type: :development
  38
+  version_requirement: 
  39
+  version_requirements: *id001
  40
+- !ruby/object:Gem::Dependency 
  41
+  name: rake-compiler
  42
+  requirement: &id002 !ruby/object:Gem::Requirement 
  43
+    requirements: 
  44
+    - - ~>
  45
+      - !ruby/object:Gem::Version 
  46
+        hash: 7
  47
+        segments: 
  48
+        - 0
  49
+        - 6
  50
+        version: "0.6"
  51
+  type: :development
  52
+  version_requirement: 
  53
+  version_requirements: *id002
  54
+- !ruby/object:Gem::Dependency 
  55
+  name: hoe
  56
+  requirement: &id003 !ruby/object:Gem::Requirement 
  57
+    requirements: 
  58
+    - - ">="
  59
+      - !ruby/object:Gem::Version 
  60
+        hash: 27
  61
+        segments: 
  62
+        - 2
  63
+        - 5
  64
+        - 0
  65
+        version: 2.5.0
  66
+  type: :development
  67
+  version_requirement: 
  68
+  version_requirements: *id003
  69
+description: |-
  70
+  Johnson wraps JavaScript in a loving Ruby embrace. It embeds the
  71
+  Mozilla SpiderMonkey JavaScript runtime as a C extension.
  72
+email: 
  73
+- jbarnette@rubyforge.org
  74
+- aaron.patterson@gmail.com
  75
+- wycats@gmail.com
  76
+- matthew@trebex.net
  77
+executables: []
  78
+
  79
+extensions: []
  80
+
  81
+extra_rdoc_files: []
  82
+
  83
+files: []
  84
+
  85
+has_rdoc: true
  86
+homepage: http://github.com/jbarnette/johnson
  87
+licenses: []
  88
+
  89
+post_install_message: 
  90
+rdoc_options: []
  91
+
  92
+require_paths: 
  93
+- lib
  94
+required_ruby_version: !ruby/object:Gem::Requirement 
  95
+  requirements: 
  96
+  - - ">="
  97
+    - !ruby/object:Gem::Version 
  98
+      hash: 3
  99
+      segments: 
  100
+      - 0
  101
+      version: "0"
  102
+required_rubygems_version: !ruby/object:Gem::Requirement 
  103
+  requirements: 
  104
+  - - ">="
  105
+    - !ruby/object:Gem::Version 
  106
+      hash: 3
  107
+      segments: 
  108
+      - 0
  109
+      version: "0"
  110
+requirements: []
  111
+
  112
+rubyforge_project: johnson
  113
+rubygems_version: 1.3.7
  114
+signing_key: 
  115
+specification_version: 3
  116
+summary: Johnson wraps JavaScript in a loving Ruby embrace
  117
+test_files: []
  118
+
  119
+
  120
+
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.