Skip to content
This repository

Match the syntax style in AST.scala to the rest of the library #37

Merged
merged 1 commit into from over 2 years ago

2 participants

Ted Nyman Coda Hale
Ted Nyman
tnm commented October 30, 2011

It's a Moonism.

Coda Hale codahale merged commit 39d4c0c into from October 30, 2011
Coda Hale codahale closed this October 30, 2011
Coda Hale
Owner

Dat Moon.

Yann Ramin theatrus referenced this pull request from a commit November 24, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 30, 2011
Ted Nyman Match the syntax style in AST.scala to the rest of the library 6ea8228
This page is out of date. Refresh to see the latest.
16  src/main/scala/com/codahale/jerkson/AST.scala
@@ -2,15 +2,15 @@ package com.codahale.jerkson
2 2
 
3 3
 object AST {
4 4
   sealed trait JValue {
5  
-    def value : Any
  5
+    def value: Any
6 6
     
7  
-    def valueAs[A] : A = value.asInstanceOf[A]
  7
+    def valueAs[A]: A = value.asInstanceOf[A]
8 8
     
9  
-    def \(fieldName : String) : JValue = JNull
  9
+    def \(fieldName: String): JValue = JNull
10 10
     
11  
-    def apply(idx : Int) : JValue = JNull
  11
+    def apply(idx: Int): JValue = JNull
12 12
     
13  
-    def \\(fieldName : String) : Seq[JValue] = Nil
  13
+    def \\(fieldName: String): Seq[JValue] = Nil
14 14
   }
15 15
 
16 16
   case object JNull extends JValue {
@@ -28,7 +28,7 @@ object AST {
28 28
   case class JArray(elements: List[JValue]) extends JValue {
29 29
     def value = null
30 30
     
31  
-    override def apply(index : Int) : JValue = {
  31
+    override def apply(index: Int): JValue = {
32 32
       try {
33 33
         elements(index)
34 34
       } catch {
@@ -42,7 +42,7 @@ object AST {
42 42
   case class JObject(fields: List[JField]) extends JValue {
43 43
     def value = null
44 44
     
45  
-    override def \(fieldName : String) : JValue = {
  45
+    override def \(fieldName: String): JValue = {
46 46
       fields.find { case JField(name, _) =>
47 47
         name == fieldName
48 48
       }.map { case JField(_, value) =>
@@ -50,7 +50,7 @@ object AST {
50 50
       }.getOrElse(JNull)
51 51
     }
52 52
     
53  
-    override def \\(fieldName : String) : Seq[JValue] = {
  53
+    override def \\(fieldName: String): Seq[JValue] = {
54 54
       fields.flatMap { 
55 55
         case JField(name, value) if name == fieldName => Seq(value) ++ (value \\ fieldName)
56 56
         case JField(_, value) => value \\ fieldName
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.