Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorRafael Teixeira <monoman@gmail.com>2003-03-12 01:55:33 +0300
committerRafael Teixeira <monoman@gmail.com>2003-03-12 01:55:33 +0300
commit7e5b5b7ad0fe7ef037078aa23f5eca5e73a773b7 (patch)
tree9296b6084848d7a0172e5afa3d55a85e65c8b729 /mcs
parent666c4f3279366b2d0bb0ac19a05a31a88243b1d8 (diff)
2003/03/11 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
* makefile.gnu : use $RUNTIME for all targets actually run the compiled program on 'test-gtk' target * mb-tokenizer.cs : no escaping of chars allowed in VB.NET (old mcs code removed) handle doubled-doublequotes (VB idiom to escape a doublequote) svn path=/trunk/mcs/; revision=12436
Diffstat (limited to 'mcs')
-rw-r--r--mcs/mbas/ChangeLog6
-rw-r--r--mcs/mbas/makefile.gnu9
-rw-r--r--mcs/mbas/mb-parser.jay6
-rw-r--r--mcs/mbas/mb-tokenizer.cs57
-rw-r--r--mcs/mbas/testmbas/WriteOK.vb4
-rw-r--r--mcs/mbas/testmbas/WriteOK2.mbs2
6 files changed, 31 insertions, 53 deletions
diff --git a/mcs/mbas/ChangeLog b/mcs/mbas/ChangeLog
index 74e1e644565..497b0679cdd 100644
--- a/mcs/mbas/ChangeLog
+++ b/mcs/mbas/ChangeLog
@@ -1,3 +1,9 @@
+2003/03/11 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * makefile.gnu : use $RUNTIME for all targets
+ actually run the compiled program on 'test-gtk' target
+ * mb-tokenizer.cs : no escaping of chars allowed in VB.NET (old mcs code removed)
+ handle doubled-doublequotes (VB idiom to escape a doublequote)
+
2003/03/04 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
* mb-parser.jay: added rule for Imports with alias
* mb-parser.jay: Friend (internal) modifier was missing,
diff --git a/mcs/mbas/makefile.gnu b/mcs/mbas/makefile.gnu
index bd671393fda..7d962e9054d 100644
--- a/mcs/mbas/makefile.gnu
+++ b/mcs/mbas/makefile.gnu
@@ -55,12 +55,13 @@ install: all
$(INSTALL) -m 755 mbas.exe $(prefix)/bin/
test: mbas.exe
- mono mbas.exe --main WriteOK testmbas/WriteOK.vb testmbas/WriteOK2.mbs
- mono testmbas/WriteOK.exe
+ $(RUNTIME) mbas.exe --main WriteOK testmbas/WriteOK.vb testmbas/WriteOK2.mbs
+ $(RUNTIME) testmbas/WriteOK.exe
verbose: mbas.exe
- mono mbas.exe --verbose --main WriteOK testmbas/WriteOK.vb testmbas/WriteOK2.mbs | less
+ $(RUNTIME) mbas.exe --verbose --main WriteOK testmbas/WriteOK.vb testmbas/WriteOK2.mbs | less
test-gtk: mbas.exe
- mono mbas.exe testmbas/gtk.vb -r gtk-sharp
+ $(RUNTIME) mbas.exe testmbas/gtk.vb -r gtk-sharp
+ $(RUNTIME) testmbas/gtk.exe
diff --git a/mcs/mbas/mb-parser.jay b/mcs/mbas/mb-parser.jay
index 4c6aebb3e57..ffe035096db 100644
--- a/mcs/mbas/mb-parser.jay
+++ b/mcs/mbas/mb-parser.jay
@@ -127,7 +127,7 @@ namespace Mono.MonoBASIC
bool OptionStrict;
bool OptionCompareBinary;
- bool UseExtendedSyntax; // for ".mbs" files
+ static public bool UseExtendedSyntax; // for ".mbs" files
public override string[] extensions()
{
@@ -377,7 +377,7 @@ compilation_unit
$$ = $4;
}
;
-
+
opt_option_directives
: /* empty */
| option_directives
@@ -540,7 +540,7 @@ imports_term
;
opt_attributes
- : /* empty */
+ : /* empty */
| attribute_sections { $$ = $1; }
;
diff --git a/mcs/mbas/mb-tokenizer.cs b/mcs/mbas/mb-tokenizer.cs
index 27f0efe2015..294903cb2ee 100644
--- a/mcs/mbas/mb-tokenizer.cs
+++ b/mcs/mbas/mb-tokenizer.cs
@@ -31,7 +31,7 @@ namespace Mono.MonoBASIC
public int ref_line = 1;
public int line = 1;
public int col = 1;
- public int current_token;
+ public int current_token = Token.EOL;
bool handle_get_set = false;
public int ExpandedTabsSize = 4;
@@ -600,42 +600,7 @@ namespace Mono.MonoBASIC
int escape (int c)
{
- int d;
- int v;
-
- d = peekChar ();
- if (c != '\\')
- return c;
-
- switch (d){
- case 'a':
- v = '\a'; break;
- case 'b':
- v = '\b'; break;
- case 'n':
- v = '\n'; break;
- case 't':
- v = '\t'; break;
- case 'v':
- v = '\v'; break;
- case 'r':
- v = 'c'; break;
- case '\\':
- v = '\\'; break;
- case 'f':
- v = '\f'; break;
- case '0':
- v = 0; break;
- case '"':
- v = '"'; break;
- case '\'':
- v = '\''; break;
- default:
- error_details = "cs1009: Unrecognized escape sequence " + (char)d;
- return -1;
- }
- getChar ();
- return v;
+ return peekChar ();
}
int getChar ()
@@ -762,7 +727,7 @@ namespace Mono.MonoBASIC
// Handle line continuation character
if (c == '_') {
- while ((c = getChar ()) != -1 && (c != '\n')){}
+ while ((c = getChar ()) != -1 && !IsEOL(c)) {}
c = getChar ();
}
// Handle EOL.
@@ -849,14 +814,18 @@ namespace Mono.MonoBASIC
System.Text.StringBuilder s = new System.Text.StringBuilder ();
while ((c = getChar ()) != -1){
- if (c == '"'){ // TODO: treat double-doublequotes
- val = s.ToString ();
- return Token.LITERAL_STRING;
+ if (c == '"'){
+ if (peekChar() == '"')
+ getChar();
+ else {
+ val = s.ToString ();
+ return Token.LITERAL_STRING;
+ }
}
- c = escape (c);
- if (c == -1)
+ if (IsEOL(c))
return Token.ERROR;
+
s.Append ((char) c);
}
}
@@ -877,7 +846,7 @@ namespace Mono.MonoBASIC
return Token.ERROR;
}
- if (current_token != Token.EOL) // if last token wasn´t EOL send it before EOF
+ if (current_token != Token.EOL) // if last token wasn't EOL send it before EOF
return Token.EOL;
return Token.EOF;
diff --git a/mcs/mbas/testmbas/WriteOK.vb b/mcs/mbas/testmbas/WriteOK.vb
index 75f854b80e0..559991a456f 100644
--- a/mcs/mbas/testmbas/WriteOK.vb
+++ b/mcs/mbas/testmbas/WriteOK.vb
@@ -15,7 +15,7 @@ Module WriteOK
IO.WriteLine("OK! via aliased name") ' from alias
nodim = 1 ' test for explicit
Console.WriteLine(nodim)
- WriteOK5.ModuleSub()
+ 'WriteOK5.ModuleSub()
End Sub
End Module
@@ -25,7 +25,7 @@ Public Class WriteOK2
Friend Shared Sub [Sub]() ' Escaped identifier
Dim Text as string ' here 'Text' isn't a keyword
Text = "This is a test!"
- Console.WriteLine("Sub:OK! - " & Text)
+ Console.WriteLine("Sub:OK! - """ & Text & """")
End Sub
End Class
diff --git a/mcs/mbas/testmbas/WriteOK2.mbs b/mcs/mbas/testmbas/WriteOK2.mbs
index e93034600b1..ff2746d8139 100644
--- a/mcs/mbas/testmbas/WriteOK2.mbs
+++ b/mcs/mbas/testmbas/WriteOK2.mbs
@@ -1,3 +1,5 @@
+'Option Explicit
+'Option Strict Off
Option Compare Text
Imports System