Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added timeunit to constants and umlaute #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions packages/ttsl-lang/src/language/grammar/ttsl.langium
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,17 @@ interface TslFunctionBlock extends TslBlock{
}

TslFunctionBlock returns TslFunctionBlock:
{TslFunctionBlock}
'{' ( statements+=TslStatement*
| timespans+=TslTimespan
'{' ( timespans+=TslTimespan statements+=TslStatement
| statements+=TslStatement)*
{TslFunctionBlock}
'{' ( statements+=TslStatement*
| timespans+=TslTimespan
'{' ( timespans+=TslTimespan statements+=TslStatement
| statements+=TslStatement)*
'}')* '}'
;

interface TslConstant extends TslModuleMember {
timespan: TslTimespan
timeunit?: TslTimeunit
^type: TslType
value: TslExpression
}
Expand All @@ -351,6 +352,7 @@ fragment TslConstantFragment:
(visibility=TslVisibility)?
'constant'
name=ID
(timeunit=TslTimeunit)?
':' ^type=TslType
('{' (timespan=TslTimespan '=' value=TslExpression)*'}' |
'=' value=TslExpression) ';'?
Expand Down Expand Up @@ -1019,7 +1021,7 @@ TslTemplateStringEnd returns TslExpression:
interface TslModifier extends TslObject{}

interface TslVisibility extends TslModifier{
isPublic?: boolean
isPublic?: boolean
isPackageprivate?: boolean
isPrivate?: boolean
}
Expand Down Expand Up @@ -1244,7 +1246,7 @@ TslColumn returns TslColumn:
// -----------------------------------------------------------------------------

terminal ID returns string: IDENTIFIER | '`' IDENTIFIER '`';
terminal fragment IDENTIFIER: /[_a-zA-Z][_a-zA-Z0-9]*/;
terminal fragment IDENTIFIER: /[_a-zA-Zäöüß][_a-zA-Z0-9äöüß]*/;

terminal FLOAT returns number
: DECIMAL_DIGIT+ '.' DECIMAL_DIGIT+ FLOAT_EXPONENT?
Expand Down
Loading