Skip to content

Commit

Permalink
add some missing elements to Kotlin grammar
Browse files Browse the repository at this point in the history
#KT-7049 Fixed
  • Loading branch information
yole committed Mar 20, 2015
1 parent a6e5c0a commit 888b655
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ else if (at(LONG_TEMPLATE_ENTRY_START)) {
/*
* literalConstant
* : "true" | "false"
* : StringWithTemplates
* : stringTemplate
* : NoEscapeString
* : IntegerLiteral
* : LongLiteral
Expand Down
2 changes: 1 addition & 1 deletion grammar/src/expressions.grm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ stringTemplate

stringTemplateElement
: RegularStringPart
: ShortTemplateEntrySTART (SimpleName | "this")
: ShortTemplateEntryStart (SimpleName | "this")
: EscapeSequence
: longTemplate
;
Expand Down
22 changes: 18 additions & 4 deletions grammar/src/lexical.grm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ IntegerLiteral
: Digit+?

FloatLiteral
: <java double literal>;
: <Java double literal>;

[helper]
HexDigit
Expand All @@ -26,12 +26,24 @@ CharacterLiteral
See [Basic types](basic-types.html)
*/

StringWithTemplates
: <single-quoted string, $ can be escaped>;

NoEscapeString
: <"""-quoted string>;

RegularStringPart
: <any character other than backslash, quote, $ or newline>

ShortTemplateEntryStart:
: "$"

EscapeSequence:
: UnicodeEscapeSequence | RegularEscapeSequence

UnicodeEscapeSequence:
: "\u" HexDigit{4}

RegularEscapeSequence:
: "\" <any character other than newline>

/**
See [String templates](basic-types.html#templates)
*/
Expand All @@ -52,7 +64,9 @@ See [Java interoperability](java-interop.html)
FieldName
: "$" SimpleName;

/*
See [Properties And Fields](properties.html)
*/

LabelName
: "@" SimpleName;
Expand Down

0 comments on commit 888b655

Please sign in to comment.