Commit graph

52 commits

Author SHA1 Message Date
Uy Ha fe9b5e0229 feat: put arguments in argument_list node 2023-06-28 14:33:56 +00:00
Uy Ha ef75262109 feat: put the body of commands into a body node
This is motivated by helping writing queries for indenting nodes easier
2023-06-28 13:14:23 +00:00
Uy Ha 686ad8b040 feat: add block command and tests for function, macro, and block 2022-12-03 13:09:00 +01:00
Access 6e51463ef3
fix(escape): \; should also be escape sequences (#9)
Towards to
https://cmake.org/cmake/help/latest/manual/cmake-language.7.html, "\;"
is also escape sequences
2022-08-26 09:50:26 +02:00
Uy Ha 3d23db47a5 fix: else and endif arguments 2022-07-08 12:04:54 +07:00
Uy Ha 5020572408 Fix bug regarding dollar sign but not variable reference 2022-01-26 22:53:15 +01:00
Uy Ha d5a0b0b992 Parse generator expression 2021-07-06 18:46:05 +02:00
Uy Ha f3ecd63233 Fix grammar to have more than one argument between parentheses 2021-07-01 17:02:13 +02:00
Uy Ha 19bb3af0d5 Parse parenteses correctly 2021-07-01 13:36:35 +02:00
Uy Ha 44a026bbf5 Fix comments being regconized incorrectly inside quoted arguments 2021-06-30 21:17:16 +02:00
Uy Ha 52cbc7add1 Seperate $, CACHE, and ENV for query purpose 2021-06-30 20:39:02 +02:00
Uy Ha 12ef0b4cab Make $.variable recursive 2021-06-30 07:40:33 +02:00
Uy Ha b8c45d2a2b Fix grammar for allowing white space to appear everywher 2021-06-29 20:35:34 +02:00
Uy Ha e3dfc2cdca Stop treating command argument as special:
- Planning to move the highlight responsibility to the highlight query
- Stop trying to parse frequently used commands
- One test is failing because of `unquoted_argument`, planning to fix
2021-06-27 21:22:42 +02:00
Uy Ha bd57f88f2d The parser now understands comments (line and bracket) 2021-06-27 13:14:31 +02:00
Uy Ha 9bc53cd0df Parse bracket comment using external scanner
- Due to bracket comment has to have the pattern /[=*[/ follow '#'
  symbol immediately, it's easier to implement it using external scanner
2021-06-26 23:30:27 +02:00
Uy Ha 3b2b47dbaa Simplify the grammar using extras and add bracket comment 2021-06-26 18:11:48 +02:00
Uy Ha 0988d2ce86 Add external parser for parsing bracket_argument and also adjust the
test cases accordingly
2021-06-26 02:19:49 +02:00
Uy Ha 5047c61bba Add message and its test case 2021-06-17 23:06:32 +02:00
Uy Ha 1a4e86b5bf Add while and its test case 2021-06-17 22:43:12 +02:00
Uy Ha 169a1d2622 Reorder rules 2021-06-17 22:33:05 +02:00
Uy Ha eb032187a2 Add if and its test cases 2021-06-17 22:32:18 +02:00
Uy Ha dabd265781 Refactor rules 2021-06-16 21:37:14 +02:00
Uy Ha c5affb3570 Complete list of keywords for foreach 2021-06-14 22:12:45 +02:00
Uy Ha 6ccd073db5 Start extracting keywords in foreach command 2021-06-14 22:07:04 +02:00
Uy Ha d23b5a89fa Hide more invisible characters nodes 2021-06-14 21:33:30 +02:00
Uy Ha d62626bcb4 Revert making command name anonymous node 2021-06-14 21:06:24 +02:00
Uy Ha 5a730d2140 Make token for command name anonymous 2021-06-13 22:39:43 +02:00
Uy Ha c0b417d056 Let foreach and endforeach accept arugments instead of variable 2021-06-13 22:34:27 +02:00
Uy Ha bcb9e4ccfb Extract foreach loop 2021-06-08 00:07:49 +02:00
Uy Ha 9e0798cc16 Hide command_invocation 2021-06-08 00:02:13 +02:00
Uy Ha 4ef112e6ce Final have foreach working 2021-06-07 23:02:35 +02:00
Uy Ha 3ff964a361 Add basic support for foreach 2021-06-06 20:38:18 +02:00
Uy Ha 265b10cf72 Start fresh with foreach 2021-06-06 15:44:05 +02:00
Uy Ha bdc2d6e321 [WIP] Start extracting overloaded foreach commands 2021-06-06 13:46:48 +02:00
Uy Ha 9d86152473 Add parsing for foreach RANGE and items 2021-06-04 14:15:12 +02:00
Uy Ha 045e372f3b Two things:
- Start using prettier for formatting
- Start adding foreach loop highlighting
2021-06-04 00:19:26 +02:00
Uy Ha 672fb317c4 Expose inner elements of variables and argument:
- Purpose: Better support nvim-treesitter highlighting
2021-05-28 22:12:15 +02:00
Uy Ha 4076762484 Fix for nvim-treesitter integration:
- Change name 'CMake' to 'cmake'
- Regenerate from grammar
2021-05-28 10:33:07 +02:00
Uy Ha 22e596f592 Clean up project 2021-05-05 20:31:08 +02:00
Uy Ha 84d2b2b3f5 Add rules for variable ref and related tests 2021-04-17 21:16:33 +02:00
Uy Ha 539e1dc77e Add quoted argument 2021-04-11 17:27:20 +02:00
Uy Ha c81ec16963 Change order of rules 2021-04-11 15:48:26 +02:00
Uy Ha 2baec3b814 Add 2 things:
- Escape sequence
- Seperation before arguments
2021-04-11 15:04:28 +02:00
Uy Ha 788ec10f19 Hide bracket argumnet details 2021-04-11 01:10:37 +02:00
Uy Ha 1e1738a814 Add brack argument 2021-04-10 21:55:47 +02:00
Uy Ha f79a9ebe9e Make unquoted_argument named 2021-04-10 18:12:41 +02:00
Uy Ha 89c8485128 Start implementing different types of argument 2021-04-10 18:03:07 +02:00
Uy Ha 192d484892 Allow spaces before the first arguments 2021-04-08 00:23:48 +02:00
Uy Ha 263fb2a5ff Complete grammar for unquoted arguments 2021-04-08 00:17:56 +02:00