Skip to content

Commit

Permalink
Merge pull request #1 from wso2/master
Browse files Browse the repository at this point in the history
Updating changes
  • Loading branch information
Shan Mahanama authored Jan 21, 2017
2 parents f993088 + 294495c commit 2949345
Show file tree
Hide file tree
Showing 549 changed files with 30,514 additions and 3,721 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Ballerina is not designed to be a general purpose language. Instead you should u
## Build from the source

- Get a clone or download source from [github](https://github.com/wso2/ballerina)
- Run maven build from the root directory
- Extract the ballerina distribution created at ballerina/modules/distribution/target/ballerina-1.0.0-SNAPSHOT.zip in to your local directory
- Run the Maven command ``mvn clean install`` from the root directory
- Extract the ballerina distribution created at ballerina/modules/distribution/target/ballerina-0.8.0-SNAPSHOT.zip in to your local directory

## Running samples

[Getting started samples](samples/getting_started)
[Getting started samples](samples/getting_started)
42 changes: 16 additions & 26 deletions docs/BallerinaRuntime.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Working with Ballerina v1.0.0-M1
# Working with Ballerina v0.8.0-SNAPSHOT

Ballerina is a new programming language for integration built on a sequence diagram metaphor.

Expand All @@ -25,12 +25,10 @@ function main (string[] args) {

####Usage:
```
ballerina.sh ballerina-file [args...]
ballerina.sh command
ballerina ballerina-file [args...]
ballerina command
```

_**Note**: Use `ballerina.bat` in Windows environment._

**Available Commands:**

version Print Ballerina version.
Expand All @@ -40,28 +38,28 @@ _**Note**: Use `ballerina.bat` in Windows environment._

1) Execute the main function of the `say-hello-world.bal` Ballerina program with no arguments.
```
ballerina.sh say-hello-world.bal
ballerina say-hello-world.bal
```

2) Execute the main function of the `hello-world.bal` Ballerina program with argument `WSO2`.
```
ballerina.sh hello-world.bal WSO2
ballerina hello-world.bal WSO2
```
3) Execute the main function of the `hello-world.bal` Ballerina program with argument `WSO2 Inc`. If the argument value contains a space, use double quote to enclose it
```
ballerina.sh hello-world.bal "WSO2 Inc"
ballerina hello-world.bal "WSO2 Inc"
```
4) Execute the main function of the `multiplier.bal` Ballerina program with arguments `5` and `10`.
```
ballerina.sh multiplier.bal 5 10
ballerina multiplier.bal 5 10
```
5) Print Ballerina version.
```
ballerina.sh version
ballerina version
```
6) Print `ballerina` help message.
```
ballerina.sh help
ballerina help
```

### **Server Mode**
Expand All @@ -71,12 +69,10 @@ and start accepting requests for deployed services.

####Usage:
```
ballerinaserver.sh [option] ballerina-file1 ballerina-file2 ...
ballerinaserver.sh command
ballerinaserver [option] ballerina-file1 ballerina-file2 ...
ballerinaserver command
```

_**Note**: Use `ballerinaserver.bat` in Windows environment._

**Available Options (Unix/Linux Only)**

start Start Ballerina Server in background.
Expand All @@ -92,33 +88,27 @@ _**Note**: Use `ballerinaserver.bat` in Windows environment._

1) Deploy `passthrough.bal` Ballerina program.
```
ballerinaserver.sh passthrough.bal
ballerinaserver passthrough.bal
```
2) Deploy `passthrough.bal` and `echo.bal` Ballerina programs.
```
ballerinaserver.sh passthrough.bal echo.bal
ballerinaserver passthrough.bal echo.bal
```
3) Print Ballerina version.
```
ballerinaserver.sh version
ballerinaserver version
```
4) Print `ballerinaserver` help message.
```
ballerinaserver.sh help
ballerinaserver help
```

## Working with Ballerina Editor.

Start Ballerina editor using,

* **Unix/Linux**
```
editor.sh
```

* **Windows**
```
editor.bat
editor
```

Access Ballerina editor via [http://localhost:9091](http://localhost:9091)
Expand Down
94 changes: 47 additions & 47 deletions docs/SyntaxSummary.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/grammar/Ballerina.g4
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ compilationUnit
( serviceDefinition
| functionDefinition
| connectorDefinition
| typeDefinition
| structDefinition
| typeConvertorDefinition
| constantDefinition
)+
Expand Down Expand Up @@ -67,11 +67,11 @@ connectorDeclaration
: qualifiedReference Identifier '=' 'new' qualifiedReference '(' expressionList? ')'';'
;

typeDefinition
: 'public'? 'type' Identifier typeDefinitionBody
structDefinition
: 'public'? 'type' Identifier structDefinitionBody
;

typeDefinitionBody
structDefinitionBody
: '{' (typeName Identifier ';')+ '}'
;

Expand Down Expand Up @@ -333,7 +333,7 @@ returnStatement

// below Identifier is only a type of 'message'
replyStatement
: 'reply' expression? ';'
: 'reply' expression ';'
;

workerInteractionStatement
Expand Down Expand Up @@ -414,7 +414,7 @@ expression
| expression ('!=') expression # binaryNotEqualExpression
| '[' expressionList ']' # arrayInitializerExpression
| '{' mapInitKeyValueList '}' # mapInitializerExpression
| 'new' (packageName ':' )? Identifier ('(' expressionList? ')')? # typeInitializeExpression
| 'new' (packageName ':' )? Identifier ('(' expressionList? ')')? # structInitializeExpression
;

mapInitKeyValueList
Expand Down
1 change: 1 addition & 0 deletions libsrc/ballerina/net/http/connector.bal
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ connector HttpConnector (string serviceUri, map options) {
native action get(HttpConnector h, string path, message m) (message) throws exception;
native action put(HttpConnector h, string path, message m) (message) throws exception;
native action post(HttpConnector h, string path, message m) (message) throws exception;
native action patch(HttpConnector h, string path, message m) (message) throws exception;
native action delete(HttpConnector h, string path, message m) (message) throws exception;
native action execute(HttpConnector h, string httpVerb, string path, message m) (message) throws exception;
}
2 changes: 2 additions & 0 deletions libsrc/ballerina/net/http/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ native function convertToRequest(message m);

native function convertToRequest(message m, string protocolVersion);

native function acceptAndReturn(int statusCode);



2 changes: 1 addition & 1 deletion modules/ballerina-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.ballerina</groupId>
<artifactId>ballerina</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>0.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 2949345

Please sign in to comment.