mIRC Home    About    Download    Register    News    Help

Print Thread
Help Documenting syntax #266539 24/12/19 03:50 PM
Joined: Apr 2010
Posts: 939
F
FroggieDaFrog Offline OP
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 939
I'm working on a text-mate style syntax highlighter(VSCode, VSStudio, Atom, Sublime, etc) and would greatly appreciate crowd sourcing the syntax documentation.

Currently what I have documented is:
- Block Comment
- Menu

Whats currently needed:
- single/line comments and how they behave within a block
- Pipe(|) behavior under various conditions
- event syntax, including but not limited to all prefixing, event names, and parameters
- alias definitions

Last edited by FroggieDaFrog; 24/12/19 07:30 PM.

I am SReject
My Stuff
Re: Help Documenting syntax [Re: FroggieDaFrog] #266541 24/12/19 07:21 PM
Joined: Jul 2014
Posts: 31
S
SykO Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2014
Posts: 31
Here is a small test from the syntax highlighter I was working on:

Code
alias singleLineCommentTest {
  ; comment
  echo -s test 1
  ; comment | echo -s test 2
  ; comment | echo -s test 3 | ;comment |
  { ; comment } | echo -s test 4
  { ; comment | } | echo -s test 5
  { ; comment | echo -s test 6 } | ; comment | echo -s test 7
  { echo -s test 8 | ; comment } | echo -s test 9
  { echo -s test 10 | ; comment | } | echo -s test 11
  echo -s test 12 | ; comment | echo -s test 13
  echo -s test 14 | 
  echo -s test 15 |
  ; comment | { echo -s test 16 }
}


Calling the command will output:

Code
test 1
test 4
test 8
test 10
test 12
test 13
test 14
test 15 |


What I got for my test:

1. If a line starts with a comment, the line is treated as a comment line.
2. If a comment is between a line, with the help of pipes, then only said part of the line is treated as a comment.

My second conclusion does have an exception, shown by:

Code
{ echo -s test 8 | ; comment } | echo -s test 9


outputs test 8, but not test 9

where as:

Code
{ ; comment } | echo -s test 4


outputs test 4

Hope this helps a bit, I will edit this reply as soon as I do more test and/or find out extra information.

Re: Help Documenting syntax [Re: SykO] #266542 24/12/19 07:29 PM
Joined: Apr 2010
Posts: 939
F
FroggieDaFrog Offline OP
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 939
Thanks!

Just to be safe, each test should be seperete from all others to avoid block-interaction behaviors.

Test #14 and #15 are related to how pipes at the end of a block or line are treated, I believe the same is true for all tests with 'empty commands'
Code
{ ... | }

Last edited by FroggieDaFrog; 24/12/19 07:31 PM.

I am SReject
My Stuff