@@ -1743,6 +1743,18 @@ long total = (data["bonusGame"]["win"].AsLong) * data["bonusGame"]["betMult"].As
1743
1743
] ) ;
1744
1744
} ) ;
1745
1745
1746
+ it ( "no arguments with space (issue #54)" , ( ) => {
1747
+ const input = Input . InMethod ( `M ();` ) ;
1748
+ const tokens = tokenize ( input ) ;
1749
+
1750
+ tokens . should . deep . equal ( [
1751
+ Token . Identifiers . MethodName ( "M" ) ,
1752
+ Token . Punctuation . OpenParen ,
1753
+ Token . Punctuation . CloseParen ,
1754
+ Token . Punctuation . Semicolon
1755
+ ] ) ;
1756
+ } ) ;
1757
+
1746
1758
it ( "one argument" , ( ) => {
1747
1759
const input = Input . InMethod ( `M(42);` ) ;
1748
1760
const tokens = tokenize ( input ) ;
@@ -1756,6 +1768,19 @@ long total = (data["bonusGame"]["win"].AsLong) * data["bonusGame"]["betMult"].As
1756
1768
] ) ;
1757
1769
} ) ;
1758
1770
1771
+ it ( "one argument with space (issue #54)" , ( ) => {
1772
+ const input = Input . InMethod ( `M (42);` ) ;
1773
+ const tokens = tokenize ( input ) ;
1774
+
1775
+ tokens . should . deep . equal ( [
1776
+ Token . Identifiers . MethodName ( "M" ) ,
1777
+ Token . Punctuation . OpenParen ,
1778
+ Token . Literals . Numeric . Decimal ( "42" ) ,
1779
+ Token . Punctuation . CloseParen ,
1780
+ Token . Punctuation . Semicolon
1781
+ ] ) ;
1782
+ } ) ;
1783
+
1759
1784
it ( "two arguments" , ( ) => {
1760
1785
const input = Input . InMethod ( `M(19, 23);` ) ;
1761
1786
const tokens = tokenize ( input ) ;
@@ -2000,6 +2025,36 @@ long total = (data["bonusGame"]["win"].AsLong) * data["bonusGame"]["betMult"].As
2000
2025
] ) ;
2001
2026
} ) ;
2002
2027
2028
+ it ( "qualified method with no arguments and space 1 (issue #54)" , ( ) => {
2029
+ const input = Input . InMethod ( `N.C.M ();` ) ;
2030
+ const tokens = tokenize ( input ) ;
2031
+
2032
+ tokens . should . deep . equal ( [
2033
+ Token . Variables . Object ( "N" ) ,
2034
+ Token . Punctuation . Accessor ,
2035
+ Token . Variables . Property ( "C" ) ,
2036
+ Token . Punctuation . Accessor ,
2037
+ Token . Identifiers . MethodName ( "M" ) ,
2038
+ Token . Punctuation . OpenParen ,
2039
+ Token . Punctuation . CloseParen ,
2040
+ Token . Punctuation . Semicolon
2041
+ ] ) ;
2042
+ } ) ;
2043
+
2044
+ it ( "qualified method with no arguments and space 2 (issue #54)" , ( ) => {
2045
+ const input = Input . InMethod ( `C.M ();` ) ;
2046
+ const tokens = tokenize ( input ) ;
2047
+
2048
+ tokens . should . deep . equal ( [
2049
+ Token . Variables . Object ( "C" ) ,
2050
+ Token . Punctuation . Accessor ,
2051
+ Token . Identifiers . MethodName ( "M" ) ,
2052
+ Token . Punctuation . OpenParen ,
2053
+ Token . Punctuation . CloseParen ,
2054
+ Token . Punctuation . Semicolon
2055
+ ] ) ;
2056
+ } ) ;
2057
+
2003
2058
it ( "store result of this.qualified method with no arguments" , ( ) => {
2004
2059
const input = Input . InMethod ( `var o = this.C.M();` ) ;
2005
2060
const tokens = tokenize ( input ) ;
0 commit comments