This repository was archived by the owner on Oct 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from PackageFactory/task/useFusionDslExtension…
…Point FEATURE: Use fusions new dsl-extension-point instead of aspecting the parser
- Loading branch information
Showing
9 changed files
with
54 additions
and
233 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
namespace PackageFactory\AtomicFusion\AFX\Dsl; | ||
|
||
use Neos\Flow\Annotations as Flow; | ||
use Neos\Fusion; | ||
use Neos\Fusion\Core\DslInterface; | ||
use PackageFactory\AtomicFusion\AFX\Service\AfxService; | ||
use PackageFactory\AtomicFusion\AFX\Exception\AfxException; | ||
|
||
/** | ||
* Class Fusion AFX Dsl | ||
* | ||
* @Flow\Scope("singleton") | ||
*/ | ||
class AfxDslImplementation implements DslInterface | ||
{ | ||
|
||
/** | ||
* Transpile the given dsl-code to fusion-code | ||
* | ||
* @param string $code | ||
* @return string | ||
* @throws Fusion\Exception | ||
*/ | ||
public function transpile($code) | ||
{ | ||
try { | ||
return AfxService::convertAfxToFusion($code); | ||
} catch (AfxException $afxException) { | ||
throw new FusionException(sprintf('Error during AFX-parsing: %s', $afxException->getMessage())); | ||
} | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
Classes/Exception/Exception.php → Classes/Exception/AfxException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
<?php | ||
|
||
namespace PackageFactory\AtomicFusion\AFX\Exception; | ||
|
||
class Exception extends \Exception | ||
class AfxException extends \Exception | ||
{ | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Neos: | ||
Fusion: | ||
dsl: | ||
afx: PackageFactory\AtomicFusion\AFX\Dsl\AfxDslImplementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,15 @@ | |
"name": "Martin Ficzel", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "Wilhelm Behncke", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"neos/fusion": "^3.0.1 || dev-master", | ||
"neos/fusion": "^3.2.0 || dev-master", | ||
"packagefactory/afx": "~2.0.1" | ||
}, | ||
"autoload": { | ||
|