diff --git a/csep.tests/xtend-gen/csep/tests/basic/.gitignore b/csep.tests/xtend-gen/csep/tests/basic/.gitignore new file mode 100644 index 0000000..509bf6f --- /dev/null +++ b/csep.tests/xtend-gen/csep/tests/basic/.gitignore @@ -0,0 +1,20 @@ +/.ArrayTest.java._trace +/.AssignTest.java._trace +/.ClassTest.java._trace +/.ControlFlowTest.java._trace +/.DictionaryTest.java._trace +/.FunctionCallTest.java._trace +/.LambdaTest.java._trace +/.LiteralTest.java._trace +/.OperatorsTest.java._trace +/.ScopeTest.java._trace +/ArrayTest.java +/AssignTest.java +/ClassTest.java +/ControlFlowTest.java +/DictionaryTest.java +/FunctionCallTest.java +/LambdaTest.java +/LiteralTest.java +/OperatorsTest.java +/ScopeTest.java diff --git a/csep.tests/xtend-gen/csep/tests/coffee/.gitignore b/csep.tests/xtend-gen/csep/tests/coffee/.gitignore new file mode 100644 index 0000000..7cf5a2c --- /dev/null +++ b/csep.tests/xtend-gen/csep/tests/coffee/.gitignore @@ -0,0 +1,4 @@ +/.NodesCoffeeTest.java._trace +/.Showcase.java._trace +/NodesCoffeeTest.java +/Showcase.java diff --git a/csep.tests/xtend-gen/csep/tests/coffee/Showcase.java b/csep.tests/xtend-gen/csep/tests/coffee/Showcase.java index ea60dec..3b775fc 100644 --- a/csep.tests/xtend-gen/csep/tests/coffee/Showcase.java +++ b/csep.tests/xtend-gen/csep/tests/coffee/Showcase.java @@ -37,7 +37,7 @@ public void test_interpolation() { _builder.append("quote = \"A picture is a fact. -- #{ author }\""); _builder.newLine(); _builder.newLine(); - _builder.append("sentence = \"#{ 22 / 7 } is a decent approximation of \uFFFD\uFFFD\""); + _builder.append("sentence = \"#{ 22 / 7 } is a decent approximation of \ufffd\ufffd\""); _builder.newLine(); this.ok(_builder); } diff --git a/csep.tests/xtend-gen/csep/tests/lexer/.PositionTest.java._trace b/csep.tests/xtend-gen/csep/tests/lexer/.PositionTest.java._trace index a7a2a26..803038f 100644 Binary files a/csep.tests/xtend-gen/csep/tests/lexer/.PositionTest.java._trace and b/csep.tests/xtend-gen/csep/tests/lexer/.PositionTest.java._trace differ diff --git a/csep.tests/xtend-gen/csep/tests/lexer/.gitignore b/csep.tests/xtend-gen/csep/tests/lexer/.gitignore new file mode 100644 index 0000000..cbcb123 --- /dev/null +++ b/csep.tests/xtend-gen/csep/tests/lexer/.gitignore @@ -0,0 +1,4 @@ +/.PositionTest.java._trace +/.TokenTest.java._trace +/PositionTest.java +/TokenTest.java diff --git a/csep.tests/xtend-gen/csep/tests/other/.gitignore b/csep.tests/xtend-gen/csep/tests/other/.gitignore new file mode 100644 index 0000000..3eae80c --- /dev/null +++ b/csep.tests/xtend-gen/csep/tests/other/.gitignore @@ -0,0 +1,6 @@ +/.CakefileTest.java._trace +/.ErrorLocationTest.java._trace +/.MissingFeaturesTest.java._trace +/CakefileTest.java +/ErrorLocationTest.java +/MissingFeaturesTest.java diff --git a/csep.tests/xtend-gen/csep/tests/parser/.gitignore b/csep.tests/xtend-gen/csep/tests/parser/.gitignore new file mode 100644 index 0000000..b591409 --- /dev/null +++ b/csep.tests/xtend-gen/csep/tests/parser/.gitignore @@ -0,0 +1,2 @@ +/.HelperTest.java._trace +/HelperTest.java diff --git a/csep.ui/src-gen/csep/ui/contentassist/AbstractCoffeeScriptProposalProvider.java b/csep.ui/src-gen/csep/ui/contentassist/AbstractCoffeeScriptProposalProvider.java index 0493e07..642fada 100644 --- a/csep.ui/src-gen/csep/ui/contentassist/AbstractCoffeeScriptProposalProvider.java +++ b/csep.ui/src-gen/csep/ui/contentassist/AbstractCoffeeScriptProposalProvider.java @@ -9,7 +9,7 @@ import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; /** - * Represents a generated, default implementation of interface {@link IProposalProvider}. + * Represents a generated, default implementation of superclass {@link org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider}. * Methods are dynamically dispatched on the first parameter, i.e., you can override them * with a more concrete subtype. */ diff --git a/csep.ui/src-gen/csep/ui/contentassist/antlr/PartialCoffeeScriptContentAssistParser.java b/csep.ui/src-gen/csep/ui/contentassist/antlr/PartialCoffeeScriptContentAssistParser.java index 6c99cba..eadbf89 100644 --- a/csep.ui/src-gen/csep/ui/contentassist/antlr/PartialCoffeeScriptContentAssistParser.java +++ b/csep.ui/src-gen/csep/ui/contentassist/antlr/PartialCoffeeScriptContentAssistParser.java @@ -15,6 +15,7 @@ /** * @author Sebastian Zarnekow - Initial contribution and API */ +@SuppressWarnings("restriction") public class PartialCoffeeScriptContentAssistParser extends CoffeeScriptParser implements IPartialContentAssistParser { private AbstractRule rule; diff --git a/csep/src-gen/csep/CoffeeScript.genmodel b/csep/src-gen/csep/CoffeeScript.genmodel index e584106..ff96b17 100644 --- a/csep/src-gen/csep/CoffeeScript.genmodel +++ b/csep/src-gen/csep/CoffeeScript.genmodel @@ -4,7 +4,7 @@ modelPluginID="csep" forceOverwrite="true" modelName="CoffeeScript" updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" complianceLevel="5.0" copyrightFields="false" editPluginID="csep.edit" editorPluginID="csep.editor" - runtimeVersion="2.8"> + runtimeVersion="2.9"> diff --git a/csep/src-gen/csep/CoffeeScript.xmi b/csep/src-gen/csep/CoffeeScript.xmi deleted file mode 100644 index 088a97b..0000000 --- a/csep/src-gen/csep/CoffeeScript.xmi +++ /dev/null @@ -1,2164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/csep/src-gen/csep/CoffeeScript.xtextbin b/csep/src-gen/csep/CoffeeScript.xtextbin new file mode 100644 index 0000000..41edaa3 Binary files /dev/null and b/csep/src-gen/csep/CoffeeScript.xtextbin differ diff --git a/csep/src-gen/csep/CoffeeScriptStandaloneSetupGenerated.java b/csep/src-gen/csep/CoffeeScriptStandaloneSetupGenerated.java index 39c00b6..8fa3284 100644 --- a/csep/src-gen/csep/CoffeeScriptStandaloneSetupGenerated.java +++ b/csep/src-gen/csep/CoffeeScriptStandaloneSetupGenerated.java @@ -24,6 +24,9 @@ public Injector createInjectorAndDoEMFRegistration() { if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi")) Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put( "xmi", new org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl()); + if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin")) + Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put( + "xtextbin", new org.eclipse.xtext.resource.impl.BinaryGrammarResourceFactoryImpl()); if (!EPackage.Registry.INSTANCE.containsKey(org.eclipse.xtext.XtextPackage.eNS_URI)) EPackage.Registry.INSTANCE.put(org.eclipse.xtext.XtextPackage.eNS_URI, org.eclipse.xtext.XtextPackage.eINSTANCE); diff --git a/csep/src-gen/csep/coffeeScript/impl/CoffeeScriptFactoryImpl.java b/csep/src-gen/csep/coffeeScript/impl/CoffeeScriptFactoryImpl.java index fe82fcc..8b52a17 100644 --- a/csep/src-gen/csep/coffeeScript/impl/CoffeeScriptFactoryImpl.java +++ b/csep/src-gen/csep/coffeeScript/impl/CoffeeScriptFactoryImpl.java @@ -30,7 +30,7 @@ public static CoffeeScriptFactory init() { try { - CoffeeScriptFactory theCoffeeScriptFactory = (CoffeeScriptFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.coffeescript.org/eclipse"); + CoffeeScriptFactory theCoffeeScriptFactory = (CoffeeScriptFactory)EPackage.Registry.INSTANCE.getEFactory(CoffeeScriptPackage.eNS_URI); if (theCoffeeScriptFactory != null) { return theCoffeeScriptFactory; diff --git a/csep/src/com/aptana/editor/coffee/parsing/lexer/CoffeeScanner.java b/csep/src/com/aptana/editor/coffee/parsing/lexer/CoffeeScanner.java index c8babb7..fdd096c 100644 --- a/csep/src/com/aptana/editor/coffee/parsing/lexer/CoffeeScanner.java +++ b/csep/src/com/aptana/editor/coffee/parsing/lexer/CoffeeScanner.java @@ -359,8 +359,7 @@ private List tokenize(String code, Map opts) code = "\n" + code; this.fOffsetCorrection -= 1; } - code = code.replaceAll("\r", "").replaceFirst( - TRAILING_SPACES.pattern(), ""); + code = code.replaceAll("\r", ""); this.fCode = code; this.fLine = 0; if (opts.containsKey("fLine")) { @@ -891,7 +890,7 @@ private int lineToken() { if (noNewlines) { this.suppressNewlines(); } else { - this.newlineToken(); + this.newlineToken(indent.length()); } return indent.length(); } @@ -969,9 +968,9 @@ private int whitespaceToken() { return 0; } - private void newlineToken() { + private void newlineToken(int i) { if (this.tag() != Terminals.TERMINATOR) { - this.token(Terminals.TERMINATOR, "\n", 1); + this.token(Terminals.TERMINATOR, "\n", i); } // return this; } diff --git a/csep/src/csep/Main.java b/csep/src/csep/Main.java new file mode 100644 index 0000000..88e9857 --- /dev/null +++ b/csep/src/csep/Main.java @@ -0,0 +1,30 @@ +package csep; + +import java.io.FileInputStream; +import java.io.IOException; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.xtext.resource.XtextResource; + +import com.google.inject.Injector; + +public class Main { + + public static void main(String[] args) throws IOException { + FileInputStream in = new FileInputStream("x.coffee"); + int c = 0; + int n = 0; + while((n=in.read())>0) c++; + in.close(); + System.out.println(c); + + + Injector i = new CoffeeScriptStandaloneSetup().createInjectorAndDoEMFRegistration(); + ResourceSet rs = i.getInstance(ResourceSet.class); + XtextResource r = (XtextResource)rs.getResource(URI.createURI("x.coffee"), true); + r.load(null); + System.out.println(r.getParseResult().getRootNode().getTotalLength()); + } + +} diff --git a/csep/x.coffee b/csep/x.coffee new file mode 100644 index 0000000..e7da85e --- /dev/null +++ b/csep/x.coffee @@ -0,0 +1,38 @@ + + + +#xxxxx + +a = 1+1 + + + + + + +1+1 + +1111+1111+111+111 +xx=1+1+1 +1+1 + + +sssss=1+1 + + + + + + + +bla = 1+1 + + + + + + + + + + diff --git a/csep/xtend-gen/csep/generator/.gitignore b/csep/xtend-gen/csep/generator/.gitignore new file mode 100644 index 0000000..4e2b68d --- /dev/null +++ b/csep/xtend-gen/csep/generator/.gitignore @@ -0,0 +1,2 @@ +/.CoffeeScriptGenerator.java._trace +/CoffeeScriptGenerator.java