Update README.md
This commit is contained in:
parent
1ae47807eb
commit
9f30f45774
31
README.md
31
README.md
|
@ -1,5 +1,7 @@
|
||||||
# Nasal Script Language
|
# Nasal Script Language
|
||||||
|
|
||||||
|
[TOC]
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
[Nasal](http://wiki.flightgear.org/Nasal_scripting_language) is a script language that used in [FlightGear](https://www.flightgear.org/).
|
[Nasal](http://wiki.flightgear.org/Nasal_scripting_language) is a script language that used in [FlightGear](https://www.flightgear.org/).
|
||||||
|
@ -50,12 +52,13 @@ Input this command to run scripts directly:
|
||||||
|
|
||||||
> ./nasal filename
|
> ./nasal filename
|
||||||
|
|
||||||
Use these commands to get some information of interpreter:
|
Use these commands to get version of interpreter:
|
||||||
|
|
||||||
> ./nasal -v
|
> ./nasal -v | -version
|
||||||
> ./nasal -version
|
|
||||||
> ./nasal -h
|
Use these commands to get version of interpreter:
|
||||||
> ./nasal -help
|
|
||||||
|
> ./nasal -h | -help
|
||||||
|
|
||||||
## Parser
|
## Parser
|
||||||
|
|
||||||
|
@ -307,21 +310,14 @@ var f=func(x,y,z,dynamic_para...)
|
||||||
### operators
|
### operators
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
1+2;
|
1+2-1*2/1;
|
||||||
1-2;
|
|
||||||
1*2;
|
|
||||||
1/2;
|
|
||||||
'str1'~'str2';
|
'str1'~'str2';
|
||||||
(1+2)*(3+4)
|
(1+2)*(3+4)
|
||||||
|
|
||||||
1+1 and 0;
|
1+1 and 0;
|
||||||
1+2*3 or 0;
|
1<0 or 1>0;
|
||||||
1<0;
|
1<=0 and 1>=0;
|
||||||
1>0;
|
1==0 or 1!=0;
|
||||||
1<=0;
|
|
||||||
1>=0;
|
|
||||||
1==0;
|
|
||||||
1!=0;
|
|
||||||
|
|
||||||
-1;
|
-1;
|
||||||
!0;
|
!0;
|
||||||
|
@ -506,8 +502,7 @@ At last,warp the '__builtin_std_cout' in a nasal file:
|
||||||
```javascript
|
```javascript
|
||||||
var print=func(elements...)
|
var print=func(elements...)
|
||||||
{
|
{
|
||||||
__builtin_std_cout(elements);
|
return __builtin_std_cout(elements);
|
||||||
return nil;
|
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue