Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2344)

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java

Issue 189433006: Support for DartBlockBody, DartExpressionBody, DartOmit in java2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
index 8a6067f3f938147c84a016fd9bf8b5cafc7f74a8..e3913243faf6a68fbc2d36987e90a7d1853b4d33 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
@@ -18,6 +18,8 @@ import com.google.dart.engine.internal.context.PerformanceStatistics;
import com.google.dart.engine.internal.context.TimestampedData;
import com.google.dart.engine.utilities.general.TimeCounter.TimeCounterHandle;
import com.google.dart.engine.utilities.io.FileUtilities;
+import com.google.dart.engine.utilities.translation.DartBlockBody;
+import com.google.dart.engine.utilities.translation.DartOmit;
import java.io.File;
import java.io.FileInputStream;
@@ -54,6 +56,7 @@ public class FileBasedSource implements Source {
/**
* The character set used to decode bytes into characters.
*/
+ @DartOmit
private static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
/**
@@ -176,6 +179,7 @@ public class FileBasedSource implements Source {
* @throws Exception if the contents of this source could not be accessed
* @see #getContents()
*/
+ @DartBlockBody({"return new TimestampedData<String>(_file.lastModified(), _file.readAsStringSync());"})
Brian Wilkerson 2014/03/07 16:12:31 This needs to be re-written to use asynchronous IO
scheglov 2014/03/07 22:47:44 This just maintains the status quo, but using a di
Brian Wilkerson 2014/03/07 23:12:06 Ok. That's reasonable.
protected TimestampedData<CharSequence> getContentsFromFile() throws Exception {
String contents;
long modificationTime = file.lastModified();
@@ -234,6 +238,7 @@ public class FileBasedSource implements Source {
* @throws Exception if the contents of this source could not be accessed
* @see #getContentsToReceiver(ContentReceiver)
*/
+ @DartBlockBody({"throw new UnsupportedOperationException();"})
Brian Wilkerson 2014/03/07 16:12:31 Shouldn't we just omit this method?
scheglov 2014/03/07 22:47:44 Yes, we can. Done.
protected void getContentsFromFileToReceiver(ContentReceiver receiver) throws Exception {
String contents;
long modificationTime = file.lastModified();

Powered by Google App Engine
This is Rietveld 408576698