Skip to content

Commit

Permalink
feat: 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
liulinboyi committed Feb 25, 2021
1 parent dedd4c7 commit 92b240a
Show file tree
Hide file tree
Showing 45 changed files with 2,303 additions and 273 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/node_modules/
/src/*.js.map
/dist/*.js.map
/examples/*/*.js.map
/dist/examples/*/*.js.map
/.cache/
/src/*/*.js.map
/dist/src/*.js.map
/dist/vm/*.js.map
/dist/test/*.js.map
/dist/src/*/*.js.map
/dist/vm/*/*.js.map
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ Integer ::= [0-9]+
Number ::= Integer Ignored
String ::= '"' '"' Ignored | '"' StringCharacter '"' Ignored
Variable ::= "$" Name Ignored // 变量
Assignment ::= Variable Ignored '=' Ignored ( String | Number ) Ignored
Assignment ::= Variable Ignored '=' Ignored ( String | Number | Variable) Ignored
Print ::= "print" "(" Ignored Variable Ignored ")" Ignored
Statement ::= Print | Assignment
SourceCode ::= Statement+
Comment ::= Ignored "#" SourceCharacter Ignored // 注释
Comment ::= Ignored "#" SourceCharacter // 注释
Expression ::= Variable Ignored Operator Ignored Variable
Operator ::= "+" | "-" | "*" | "/"
```

Expand All @@ -34,3 +36,6 @@ npm run test
## Contributors
- [karminski](https://github.com/karminski)
- [liulinboyi](https://github.com/liulinboyi)


# 最后把代码转成JavaScript的AST然后使用[javascript的解释器canjs](https://github.com/jrainlau/canjs)执行代码.
File renamed without changes.
5 changes: 5 additions & 0 deletions demo/hello-world-2.pineapple
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#$a = 0
$b = 1
print($b)
$e = "啊哈哈哈哈"
#$c = $b
File renamed without changes.
21 changes: 21 additions & 0 deletions dist/examples/pineapple/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions src/backend.js → dist/src/backend.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/definition.js → dist/src/definition.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
80 changes: 47 additions & 33 deletions src/lexer1.js → dist/src/lexer1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 19 additions & 8 deletions src/parser.js → dist/src/parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions dist/src/parser/Assignment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 92b240a

Please sign in to comment.