-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
126 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "mindustry_logic_bang_lang" | ||
version = "0.11.0" | ||
version = "0.11.1" | ||
edition = "2021" | ||
|
||
authors = ["A4-Tacks <[email protected]>"] | ||
|
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,21 @@ | ||
#** | ||
* 这是0.11.1新加入的语法, 它可以在不创建一个块作用域的情况下来编写行单元. | ||
* 虽然对于使用者来说大多情况用不上, 但是在一些特殊场景还是有些用的. | ||
* | ||
* 当然, 这个语法的目的是直接解决语法分析器中只能展开为一个行. | ||
* 有了这个后, 无需为了展开为多行添加一个块作用域, 直接使用内联块即可 | ||
*# | ||
|
||
print A; | ||
inline { | ||
const A = 2; | ||
print A; | ||
} | ||
print A; | ||
#* >>> | ||
print A | ||
print 2 | ||
print 2 | ||
*# | ||
# 可以看到, 内联块并没有创建一个块作用域, 相当于这个块直接去掉了 | ||
# 所以内联块内常量在内联块外依旧可以使用 |
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
" Vim syntax file | ||
" Language: mindustry_logic_bang_lang (mdtlbl) | ||
" Maintainer: A4-Tacks <[email protected]> | ||
" Last Change: 2023-8-11 | ||
" Last Change: 2023-8-24 | ||
" URL: https://github.com/A4-Tacks/mindustry_logic_bang_lang | ||
|
||
" 已加载高亮时就退出 | ||
|
@@ -22,13 +22,25 @@ endif | |
" 大小写敏感 {{{1 | ||
syn case match | ||
|
||
|
||
" 控制语句 {{{1 | ||
" 一些关键字 {{{1 | ||
syn keyword mdtlblKeyword | ||
\ while do skip goto if elif else | ||
\ switch case const take gwhile setres select | ||
\ inline | ||
\ op set noop print | ||
hi link mdtlblKeyword Keyword | ||
|
||
syn keyword mdtlblOpFunKeyword | ||
\ add sub mul div idiv mod pow | ||
\ equal notEqual land lessThan lessThanEq greaterThan greaterThanEq | ||
\ strictEqual shl shr or and xor max | ||
\ min angle len noise not abs log | ||
\ floor ceil sqrt rand sin cos tan | ||
\ asin acos atan lnot | ||
hi link mdtlblOpFunKeyword Operator | ||
|
||
syn match mdtlblCmpTreeOper /&&\|||\|!/ | ||
hi link mdtlblCmpTreeOper Operator | ||
|
||
" 注释 {{{1 | ||
syn region mdtlblComment start=/#/ end=/$/ | ||
|
@@ -57,6 +69,12 @@ hi link mdtlblOtherValue Identifier | |
syn match mdtlblNumber /\v<(0(x\-?[0-9a-fA-F][0-9a-fA-F_]*|b\-?[01][_01]*)|\-?[0-9][0-9_]*(\.[0-9][0-9_]*)?)>/ | ||
hi link mdtlblNumber Number | ||
|
||
syn match mdtlblBoolean /\v<true|false>/ | ||
hi link mdtlblBoolean Boolean | ||
|
||
syn match mdtlblNull /\<null\>/ | ||
hi link mdtlblNull Boolean | ||
|
||
syn match mdtlblResultHandle /\$/ | ||
hi link mdtlblResultHandle Identifier | ||
|
||
|