/*
 * Copyright (c) 2014-2015 Neil Ellis
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sillelien.dollar.api.script;

public interface SourceSegment {

    /**
     * Returns the complete source code from which this segment comes.
     *
     * @return the source
     */
    String getCompleteSource();

    /**
     * The length of the segment.
     *
     * @return the length
     */
    int getLength();

    /**
     * Gets a short hash code of the complete source.
     *
     * @return the short hash
     */
    String getShortHash();

    /**
     * Returns the name of the source file from which the source originates.
     *
     * @return the source file
     */
    String getSourceFile();

    /**
     * Returns a message describing the position in the source of this segment.
     *
     * @return the source message
     */
    String getSourceMessage();

    /**
     * Gets the source segment.
     *
     * @return the source segment
     */
    String getSourceSegment();

    /**
     * Get's the starting point in the {@link #getCompleteSource()} of this source code segment.
     *
     * @return the starting point
     */
    int getStart();
}

@@ -1,13 +1,16 @@
 /*%0A *
+   
  Copyrig
@@ -28,9 +28,9 @@
 -201
-5
+7
  Nei
@@ -42,16 +42,19 @@
 is%0A *%0A *
+   
  License
@@ -112,16 +112,19 @@
 se%22);%0A *
+   
  you may
@@ -183,16 +183,19 @@
 ense.%0A *
+   
  You may
@@ -239,16 +239,19 @@
 *       
+  
+ 
 http://w
@@ -290,16 +290,19 @@
 .0%0A *%0A *
+   
  Unless 
@@ -364,16 +364,19 @@
 tware%0A *
+   
  distrib
@@ -436,16 +436,19 @@
 ASIS,%0A *
+   
  WITHOUT
@@ -515,16 +515,19 @@
 lied.%0A *
+   
  See the
@@ -589,16 +589,19 @@
 s and%0A *
+   
  limitat
@@ -1423,24 +1423,198 @@
 Message();%0A%0A
+    /**%0A     * Returns a message describing the position in the source of this segment.%0A     *%0A     * @return the source message%0A     */%0A    String getShortSourceMessage();%0A%0A
     /**%0A    

Work on new scope system.