Skip to content

Commit

Permalink
Chnaged tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pogromca-SCP committed Feb 28, 2024
1 parent de2dda5 commit 5d04944
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 21 deletions.
32 changes: 16 additions & 16 deletions Grammar.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# NOTE: The entire scripting language is NOT case sensitive!
# NOTE: Symbols [, ], # and keywords can be quoted with \ when they should be used as text

script -> line*
line -> expression? comment? # Lines can be extended by ending them with \
script -> line*
line -> expression? comment? # Lines can be extended by ending them with \

expression -> directive | command # Expression contents can be modified with script arguments
script_arg -> "$(" NUMBER ")"
expression -> directive | command # Expression contents can be modified with script arguments
script_arg -> "$(" NUMBER ")"

command -> TEXT argument*
argument -> variable | TEXT
variable -> \S* ("$(" "^"* TEXT ")" \S*)+
command -> TEXT argument*
argument -> variable | TEXT
variable -> \S* ("$(" "^"* TEXT ")" \S*)+

directive -> "[" directive_body "]"
directive -> "[" directive_body "]"
directive_body -> foreach_loop | if_expr | delay_expr | forrandom_loop | sequence
foreach_loop -> expression "foreach" TEXT # Inner expression gets access to iterated objects properties through variables
if_expr -> (expression "if")? expression ("else" expression)?
delay_expr -> expression "delayby" NUMBER TEXT?
if_expr -> (expression "if")? expression ("else" expression)?
delay_expr -> expression "delayby" NUMBER TEXT?
forrandom_loop -> expression "forrandom" TEXT (NUMBER "%"?)? ("else" expression)? # Inner expressions get access to iterated objects properties through variables
sequence -> expression ("|" expression)+
sequence -> expression ("|" expression)+

comment -> "#" comment_body
comment -> "#" comment_body
comment_body -> permissions_guard | scope_guard | [^!?] .*
permissions_guard -> "!" TEXT*
scope_guard -> "?" scope_name*
scope_name -> "RemoteAdmin" | "Console" | "GameConsole"
scope_guard -> "?" scope_name*
scope_name -> "RemoteAdmin" | "Console" | "GameConsole"

TEXT -> \S+
NUMBER -> [0-9]+
TEXT -> \S+
NUMBER -> [0-9]+
Loading

0 comments on commit 5d04944

Please sign in to comment.