Skip to content

Commit

Permalink
Version 0.0.4
Browse files Browse the repository at this point in the history
- cleanup .idea/ files
- add release notes
- Rholang red file icon
  • Loading branch information
tgrospic committed Jan 27, 2018
1 parent 0fdf446 commit 6f6d17f
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 77 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@ out/
gen/
*.java~
/*.jar
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/uiDesigner.xml
.idea/misc.xml

.idea/
7 changes: 0 additions & 7 deletions .idea/kotlinc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ More info on [README#install](./README.md#install) page section.
## TODO

- write Formatter
- write Completion Contributor
- write Reference Contributor
- plugin actions
- write [Completion Contributor][idea-completion]
- write [Reference Contributor][idea-reference]
- add [plugin actions][idea-plugin-actions]
- connect with the compiler (get semantic info)
- ...

[idea-completion]: https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/completion_contributor.html
[idea-reference]: https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/reference_contributor.html
[idea-plugin-actions]: https://www.jetbrains.org/intellij/sdk/docs/basics/action_system.html
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ Any feedback, suggestions, bugs, testing, pull-requests, issues are very welcome
### Development

- setup [IntelliJ dev-plugin prerequisites][idea-dev-setup]
- open repo in the editor
- open repo in the editor and import `rholang-idea.iml`
- generate Java parser from `Rho.bnf` through the file context menu [Generate Parser Code][idea-gen-parser]
- generate Java lexer from `Rho.flex` through the file context menu [Run JFlex Generator][idea-gen-lexer]
- generate Java lexer from `Rho.flex` through the file context menu [Run JFlex Generator][idea-gen-lexer] (choose _out_ or _gen_ folder)
- build the project (choose _IntelliJ SDK_ and language level _8_)
- create new Plugin Run configuration with default setup
- run/debug in a separate editor
- optionally, to keep formatting consistent install plugin for [EditorConfig][editor-config]

### Test

Intellij has provide some test frameworks.These framework do simplified verifying work. For more detail you can read [IntelliJ Platform SDK DevGuide
][idea-test-guide]
Intellij has provide some test frameworks. These framework do simplified verifying work. For more detail you can read [IntelliJ Platform SDK DevGuide][idea-test-guide].

#### How to use

Expand All @@ -63,21 +64,39 @@ Then rerun the test case, and you'll find it works.

### TODO

- write more tests and configure CI
- write Formatter
- write [Completion Contributor][idea-completion]
- write [Reference Contributor][idea-reference]
- add [plugin actions][idea-plugin-actions]
- connect with the compiler (get semantic info)
- ...

## Release Notes

### 0.0.4 [@AbnerZheng](https://github.com/AbnerZheng)
- Implemented folding feature.
- Added initial tests.

### 0.0.3
- Syntax: Contracts as processes (recursive).
- Syntax: Fix arithmetic operators.
- New file icon.

### 0.0.2
- Contributing info, plugin name change.

### 0.0.1
- Initial release. Syntax highlighting.

## License

[The MIT License (MIT)][license]

[releases]: https://github.com/tgrospic/rholang-idea/releases
[rchain-coop]: https://www.rchain.coop
[rho-github]: https://github.com/rchain/rchain/tree/master/rholang
[rho-bnf-origin]: https://github.com/rchain/rchain/blob/e1b77e7b942e8f1bc98d1e5fe7705f51c2e9440d/rholang/src/main/bnfc/rholang.cf
[rho-bnf-origin]: https://github.com/rchain/rchain/blob/2710ac95a304afd3840f3c77d72ee37e607dbf53/rholang/src/main/bnfc/rholang.cf
[rho-idea-plugin]: https://plugins.jetbrains.com/plugin/9833-rholang
[arch-rholang]: http://rchain-architecture.readthedocs.io/en/latest/contracts/contract-design.html#rholang-a-concurrent-language
[arch-namespace-logic]: http://rchain-architecture.readthedocs.io/en/latest/contracts/namespaces.html#namespace-logic
Expand All @@ -92,6 +111,7 @@ Then rerun the test case, and you'll find it works.
[idea-reference]: https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/reference_contributor.html
[idea-plugin-actions]: https://www.jetbrains.org/intellij/sdk/docs/basics/action_system.html
[idea-test-guide]: https://www.jetbrains.org/intellij/sdk/docs/tutorials/writing_tests_for_plugins.html
[editor-config]: http://editorconfig.org

[beta-badge]: https://cdn.rawgit.com/tgrospic/rholang-idea/master/docs/beta-0.0.3.svg
[beta-badge]: https://cdn.rawgit.com/tgrospic/rholang-idea/master/docs/beta-0.0.4.svg
[license]: https://github.com/tgrospic/rholang-idea/blob/master/LICENSE
4 changes: 2 additions & 2 deletions docs/beta-0.0.3.svg → docs/beta-0.0.4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

<change-notes><![CDATA[
<ul>
<li><b>0.0.4 @AbnerZheng</b>:
<ul>
<li>Implemented folding feature.</li>
<li>Added initial tests.</li>
</ul>
</li>
<li><b>0.0.3</b>:
<ul>
<li>Syntax: Contracts as processes (recursive).</li>
Expand Down
17 changes: 4 additions & 13 deletions rholang-idea.iml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PLUGIN_MODULE" version="4">
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/resources/META-INF/plugin.xml" />
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/out/production/rholang-idea" />
<output-test url="file://$MODULE_DIR$/out/test/rholang-idea" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
Expand All @@ -12,15 +13,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="gen" level="project" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/bin/jflex-1.6.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
</module>
4 changes: 2 additions & 2 deletions src/coop/rchain/lang/RhoIcons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package coop.rchain.lang
import com.intellij.openapi.util.IconLoader

object RhoIcons {
val BLACK_EDITION = IconLoader.getIcon("/coop/rchain/lang/icons/rholang-black-16.png")
val RED_EDITION = IconLoader.getIcon("/coop/rchain/lang/icons/rholang-red-16.png")

val DEFAULT = BLACK_EDITION
val DEFAULT = RED_EDITION
}
Binary file removed src/coop/rchain/lang/icons/rholang-black-16.png
Binary file not shown.
Binary file added src/coop/rchain/lang/icons/rholang-red-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 28 additions & 18 deletions src/rholang.cf
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
-- https://github.com/rchain/rchain/blob/2710ac95a304afd3840f3c77d72ee37e607dbf53/rholang/src/main/bnfc/rholang.cf

-- Top level contract declaration
DContr. Contr ::= "contract" Name "(" [CPattern] ")" "=" "{" Proc "}" ;
DContr. Contr ::= Proc1 ;

-- Processes
PNil. Proc4 ::= "Nil" ;
PValue. Proc4 ::= Value;
PDrop. Proc3 ::= "*" Chan ;
PInject. Proc3 ::= "#" Chan ;
PLift. Proc2 ::= Chan "!" "(" [Proc] ")" ;
PFoldL. Proc1 ::= "sum" "(" Bind "/:" Bind ")" "{" Proc "}" ;
PFoldR. Proc1 ::= "total" "(" Bind ":\\" Bind ")" "{" Proc "}" ;
PInput. Proc1 ::= "for" "(" [Bind] ")" "{" Proc "}" ;
PChoice. Proc1 ::= "select" "{" [CBranch] "}" ;
PMatch. Proc1 ::= "match" Proc "with" [PMBranch] ;
PNew. Proc1 ::= "new" [Var] "in" Proc1 ;
PConstr. Proc1 ::= Name "(" [Proc] ")" ;
PPar. Proc ::= Proc "|" Proc1 ;
PNil. Proc4 ::= "Nil" ;
PValue. Proc4 ::= Value;
PDrop. Proc3 ::= "*" Chan ;
PInject. Proc3 ::= "#" Chan ;
PLift. Proc2 ::= Chan "!" "(" [Proc] ")" ;
PFoldL. Proc1 ::= "sum" "(" Bind "/:" Bind ")" "{" Proc "}" ;
PFoldR. Proc1 ::= "total" "(" Bind ":\\" Bind ")" "{" Proc "}" ;
PInput. Proc1 ::= "for" "(" [Bind] ")" "{" Proc "}" ;
PChoice. Proc1 ::= "select" "{" [CBranch] "}" ;
PMatch. Proc1 ::= "match" Proc "with" [PMBranch] ;
PNew. Proc1 ::= "new" [Var] "in" Proc1 ;
PPrint. Proc1 ::= "print" "(" Proc ")" ;
PConstr. Proc1 ::= Var "(" [Proc] ")" ;
PContr. Proc1 ::= "contract" Var "(" [CPattern] ")" "=" "{" Proc "}" ;
PPar. Proc ::= Proc "|" Proc1 ;
separator nonempty Proc "," ;
_. Proc ::= Proc1 ;
_. Proc1 ::= Proc2 ;
Expand Down Expand Up @@ -47,6 +51,7 @@ QInt. Quantity7 ::= Integer ;
QDouble. Quantity7 ::= Double ;
QString. Quantity7 ::= String;
QVar. Quantity7 ::= Var;
QMap. Quantity7 ::= "Map()" ;
QDot. Quantity6 ::= Quantity7 "." Var "(" [Quantity] ")" ;
QNeg. Quantity5 ::= "-" Quantity6 ;
QMult. Quantity4 ::= Quantity4 "*" Quantity5 ;
Expand Down Expand Up @@ -88,16 +93,16 @@ VarPtWild. VarPattern ::= "_" ;
separator VarPattern "," ;

-- Process patterns
PPtVal. PPattern4 ::= ValPattern ;
PPtVar. PPattern4 ::= VarPattern ;
PPtNil. PPattern4 ::= "Nil" ;
PPtVal. PPattern4 ::= ValPattern ;
PPtDrop. PPattern3 ::= "*" CPattern ;
PPtInject. PPattern3 ::= "#" CPattern ;
PPtOutput. PPattern2 ::= CPattern "!" "(" [PPattern] ")" ;
PPtInput. PPattern1 ::= "for" "(" [PatternBind] ")" "{" PPattern "}" ;
PPtMatch. PPattern1 ::= "match" PPattern "with" [PatternPatternMatch] ;
PPtNew. PPattern1 ::= "new" [VarPattern] "in" PPattern1 ;
PPtConstr. PPattern1 ::= Name "(" [PPattern] ")" ;
PPtConstr. PPattern1 ::= Var "(" [PPattern] ")" ;
PPtPar. PPattern ::= PPattern "|" PPattern1 ;
separator PPattern "," ;
coercions PPattern 4 ;
Expand All @@ -117,21 +122,26 @@ PtBranch. PatternPatternMatch ::= PPattern "=>" "{" PPattern "}" ;
separator nonempty PatternPatternMatch "" ;

-- Value patterns

-- We only allow for constants in pattern matches
-- unlike for Procs which can have arbitrary operations
VPtStruct. ValPattern ::= Var "{" [PPattern] "}" ;
VPtTuple. ValPattern ::= "<" [PPattern] ">" ;
VPtTrue. ValPattern ::= "true" ;
VPtFalse. ValPattern ::= "false" ;
VPtInt. ValPattern ::= Integer ;
VPtDbl. ValPattern ::= Double ;
VPtNegInt. ValPattern ::= "-" Integer;
VPtNegDbl. ValPattern ::= "-" Double;
VPtStr. ValPattern ::= String ;
--VPtString. ValPattern ::= ;
--VPtArray. ValPattern ::= ;
--VPtList. ValPattern ::= ;
separator nonempty ValPattern "," ;

-- Names and variables
token Name (upper (letter | digit | '_' | '\'')*) ;
token Var (lower (letter | digit | '_' | '\'')*) ;
token Name (upper (letter | digit | '_' | '\'' | '-' )*) ;
token Var (lower (letter | digit | '_' | '\'' | '-')*) ;

separator nonempty Var "," ;
separator nonempty Name "," ;
Expand Down

0 comments on commit 6f6d17f

Please sign in to comment.