-
-
Notifications
You must be signed in to change notification settings - Fork 184
Casting ambiguous syntax #181
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
Merged
Perryvw
merged 5 commits into
TypeScriptToLua:master
from
andreiradu:casting_ambiguous_syntax
Sep 4, 2018
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4709254
-added fail case
0db3e15
-added ; at the end of statements to avoid ambyguous lua syntax
a8c5c99
-updated tests
805f23d
-removed extra newline from assingments
d86d6d8
Merge remote-tracking branch 'origin/master' into casting_ambiguous_s…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| Namespace.myFunction() | ||
| Namespace.myFunction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,9 @@ | ||
| local quoteInDoubleQuotes = "\' \' \'" | ||
|
|
||
| local quoteInTemplateString = "\' \' \'" | ||
|
|
||
| local doubleQuoteInQuotes = "\" \" \"" | ||
|
|
||
| local doubleQuoteInDoubleQuotes = "\" \" \"" | ||
|
|
||
| local doubleQuoteInTemplateString = "\" \" \"" | ||
|
|
||
| local escapedCharsInQuotes = "\\ \0 \b \t \n \v \f \" \' \`" | ||
|
|
||
| local escapedCharsInDoubleQUotes = "\\ \0 \b \t \n \v \f \" \' \`" | ||
|
|
||
| local escapedCharsInTemplateString = "\\ \0 \b \t \n \v \f \" \' \`" | ||
|
|
||
| local nonEmptyTemplateString = "Level 0: \n\t "..tostring("Level 1: \n\t\t "..tostring("Level 3: \n\t\t\t "..tostring("Last level \n --").." \n --").." \n --").." \n --" | ||
|
|
||
| local quoteInDoubleQuotes = "\' \' \'"; | ||
| local quoteInTemplateString = "\' \' \'"; | ||
| local doubleQuoteInQuotes = "\" \" \""; | ||
| local doubleQuoteInDoubleQuotes = "\" \" \""; | ||
| local doubleQuoteInTemplateString = "\" \" \""; | ||
| local escapedCharsInQuotes = "\\ \0 \b \t \n \v \f \" \' \`"; | ||
| local escapedCharsInDoubleQUotes = "\\ \0 \b \t \n \v \f \" \' \`"; | ||
| local escapedCharsInTemplateString = "\\ \0 \b \t \n \v \f \" \' \`"; | ||
| local nonEmptyTemplateString = "Level 0: \n\t "..tostring("Level 1: \n\t\t "..tostring("Level 3: \n\t\t\t "..tostring("Last level \n --").." \n --").." \n --").." \n --"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| local e = 10 | ||
|
|
||
| local e = 10; | ||
| repeat | ||
| do | ||
| e = (e-1) | ||
| e = (e-1); | ||
| end | ||
| ::__continue0:: | ||
| until not (e>0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| classInstance:colonMethod() | ||
| classInstance.dotMethod() | ||
| interfaceInstance:colonMethod() | ||
| interfaceInstance.dotMethod() | ||
| TestNameSpace.dotMethod() | ||
| TestNameSpace.dotMethod2() | ||
| classInstance:colonMethod(); | ||
| classInstance.dotMethod(); | ||
| interfaceInstance:colonMethod(); | ||
| interfaceInstance.dotMethod(); | ||
| TestNameSpace.dotMethod(); | ||
| TestNameSpace.dotMethod2(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ val1=0 | |
| val2=2 | ||
| val3=3 | ||
| val4="bye" | ||
| local a = val1 | ||
| local a = val1; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| local a = {} | ||
|
|
||
| a["abc"] = "def" | ||
| local a = {}; | ||
| a["abc"] = "def"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| local exports = exports or {} | ||
| local test = nil | ||
|
|
||
| test = 1 | ||
| local test = nil; | ||
| test = 1; | ||
| exports.test = test | ||
| return exports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| local exports = exports or {} | ||
| local test = "test" | ||
|
|
||
| local test = "test"; | ||
| exports.test = test | ||
| return exports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| local test = "test" | ||
| local test = "test"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| local f = function(x) return ({x = x}) end | ||
| local f = function(x) return ({x = x}) end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| xpcall(function() | ||
| local a = 42 | ||
|
|
||
| local a = 42; | ||
| end, | ||
| function(er) | ||
| local b = "fail" | ||
|
|
||
| local b = "fail"; | ||
| end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| xpcall(function() | ||
| local a = 42 | ||
|
|
||
| local a = 42; | ||
| end, | ||
| function(er) | ||
| local b = "fail" | ||
|
|
||
| local b = "fail"; | ||
| end) | ||
| local c = "finally" | ||
| local c = "finally"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| xpcall(function() | ||
| local a = 42 | ||
|
|
||
| local a = 42; | ||
| end, | ||
| function(e) | ||
| end) | ||
| local b = "finally" | ||
| local b = "finally"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| local test1 = 10 | ||
|
|
||
| local test2 = 10 | ||
| local test1 = 10; | ||
| local test2 = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| local d = 10 | ||
|
|
||
| local d = 10; | ||
| while d>0 do | ||
| do | ||
| d = (d-1) | ||
| d = (d-1); | ||
| end | ||
| ::__continue0:: | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there also be a
;here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, you know a while will always follow, so there's no ambiguity. I've tried not to add ; where they weren't needed.