mirror of
https://codeberg.org/NLnet/takentaal.git
synced 2025-08-30 06:20:06 +00:00
Split up description text into smaller tokens so they have lowest precedence
Tokens that should appear at the start of a line are now prepended with EOL to make them precise.
This commit is contained in:
parent
f9e92b8152
commit
c116614208
2 changed files with 12 additions and 17 deletions
4
example
4
example
|
@ -14,7 +14,7 @@ This description has # ' " [] symbols and ü © Ð Latin-1 chars.
|
||||||
|
|
||||||
## {1000} Second task
|
## {1000} Second task
|
||||||
|
|
||||||
This is the description of the second task.
|
This is the description of the {} second task for project 10.
|
||||||
|
|
||||||
* {500} First subtask
|
* {500} First subtask
|
||||||
- {500} \2nd subtask
|
- {500} 2nd subtask
|
||||||
|
|
25
takentaal.g4
25
takentaal.g4
|
@ -17,14 +17,17 @@ grammar takentaal;
|
||||||
takentaal
|
takentaal
|
||||||
: header
|
: header
|
||||||
plan
|
plan
|
||||||
|
EOL*
|
||||||
;
|
;
|
||||||
|
|
||||||
header
|
header
|
||||||
: 'takentaal v0.1.0'
|
: 'takentaal v0.1.0'
|
||||||
;
|
;
|
||||||
|
|
||||||
|
// Any implicit and explity lexer token that may appear in a text should be listed
|
||||||
|
// in this definition.
|
||||||
text
|
text
|
||||||
: (S | CHAR | WORD)+
|
: (INT | '{' | '}' | S | CHAR | WORD)+
|
||||||
;
|
;
|
||||||
|
|
||||||
plan
|
plan
|
||||||
|
@ -49,7 +52,7 @@ subtask
|
||||||
;
|
;
|
||||||
|
|
||||||
amount
|
amount
|
||||||
: START_AMOUNT S* INT END_AMOUNT
|
: '{' S* INT '}'
|
||||||
|
|
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -62,23 +65,23 @@ TASK_TOKEN
|
||||||
;
|
;
|
||||||
|
|
||||||
SUBTASK_TOKEN
|
SUBTASK_TOKEN
|
||||||
: EOL+ (SUBTASK_NEW_TOKEN | SUBTASK_PARTIAL_TOKEN | SUBTASK_COMPLETE_TOKEN | SUBTASK_OBSOLETE_TOKEN)
|
: (SUBTASK_NEW_TOKEN | SUBTASK_PARTIAL_TOKEN | SUBTASK_COMPLETE_TOKEN | SUBTASK_OBSOLETE_TOKEN)
|
||||||
;
|
;
|
||||||
|
|
||||||
SUBTASK_NEW_TOKEN
|
SUBTASK_NEW_TOKEN
|
||||||
: '-'
|
: EOL+ '-'
|
||||||
;
|
;
|
||||||
|
|
||||||
SUBTASK_PARTIAL_TOKEN
|
SUBTASK_PARTIAL_TOKEN
|
||||||
: '/'
|
: EOL+ '/'
|
||||||
;
|
;
|
||||||
|
|
||||||
SUBTASK_COMPLETE_TOKEN
|
SUBTASK_COMPLETE_TOKEN
|
||||||
: '*'
|
: EOL+ '*'
|
||||||
;
|
;
|
||||||
|
|
||||||
SUBTASK_OBSOLETE_TOKEN
|
SUBTASK_OBSOLETE_TOKEN
|
||||||
: '!'
|
: EOL+ '!'
|
||||||
;
|
;
|
||||||
|
|
||||||
S
|
S
|
||||||
|
@ -102,14 +105,6 @@ fragment DIGIT
|
||||||
: [0-9]
|
: [0-9]
|
||||||
;
|
;
|
||||||
|
|
||||||
START_AMOUNT
|
|
||||||
: '{'
|
|
||||||
;
|
|
||||||
|
|
||||||
END_AMOUNT
|
|
||||||
: '}'
|
|
||||||
;
|
|
||||||
|
|
||||||
// Match printable characters, except space which is covered by S
|
// Match printable characters, except space which is covered by S
|
||||||
CHAR
|
CHAR
|
||||||
: [!-~\u00A0-\u33FF] // ASCII and UNICODE
|
: [!-~\u00A0-\u33FF] // ASCII and UNICODE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue