fork download
  1. Imports System.Text.RegularExpressions
  2. Imports System
  3.  
  4. Module Module1
  5.  
  6. Function ExtrairBlocos(ByVal texto As String) As List(Of String)
  7. Dim blocos As New List(Of String)
  8. blocos = Regex.Split(texto, "(""[^""]*""|\s+)").ToList()
  9. blocos.RemoveAll(Function(bloco) String.IsNullOrWhiteSpace(bloco))
  10. Return blocos
  11. End Function
  12.  
  13. Sub Main()
  14. Dim texto As String = "if ""esse campo tem espaços"" = true"
  15. Dim blocos As New List(Of String)
  16. 'blocos = ExtrairBlocos(texto)
  17.  
  18. 'For Each bloco As String In blocos
  19. ' Console.WriteLine("{0}", bloco)
  20. 'Next
  21. Console.ReadLine()
  22. End Sub
  23.  
  24. End Module
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Visual Basic.Net Compiler version 0.0.0.5943 (Mono 3.8 - tarball)
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.

/home/nt3FDD/prog.vb (9,35) : error VBNC90019: Expected ')'.
/home/nt3FDD/prog.vb (9,35): Compiler error around this location, the compiler hasn't implemented the error message, nor error recovery, so the compiler will probably crash soon.
   at vbnc.Helper.ErrorRecoveryNotImplemented(Span Location)
   at vbnc.Parser.ParseInvocationOrIndexExpression(vbnc.ParsedObject Parent, vbnc.Expression First)
   at vbnc.Parser.ParseIdentifier(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseExponent(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseUnaryPlusMinus(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseMultDiv(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseIntDiv(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseMod(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParsePlusMinus(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseConcat(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseBitshift(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseComparison(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseNot(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseAnd_AndAlso(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseOr_OrElse_Xor(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseExpression(vbnc.ExpressionParseInfo Info)
   at vbnc.Parser.ParseCodeBlock(vbnc.ParsedObject Parent, Boolean IsOneLiner)
   at vbnc.Parser.ParseFunctionDeclaration(vbnc.TypeDeclaration Parent, vbnc.ParseAttributableInfo Info)
   at vbnc.Parser.ParseTypeMembers(vbnc.TypeDeclaration Parent)
   at vbnc.Parser.ParseModuleDeclaration(vbnc.ParsedObject Parent, vbnc.Attributes Attributes, System.String Namespace)
   at vbnc.Parser.ParseTypeDeclaration(vbnc.ParsedObject Parent, vbnc.Attributes Attributes, System.String Namespace)
   at vbnc.Parser.ParseAssemblyMembers(vbnc.AssemblyDeclaration Parent, System.String RootNamespace)
   at vbnc.Parser.ParseAssemblyDeclaration(System.String RootNamespace, vbnc.AssemblyDeclaration assembly)
   at vbnc.Parser.Parse(System.String RootNamespace, vbnc.AssemblyDeclaration assembly)
   at vbnc.Compiler.Compile_Parse()
   at vbnc.Compiler.Compile()
   at vbnc.Compiler.Compile(System.String[] CommandLine)
   at vbnc.Main.Main(System.String[] CmdArgs)
/home/nt3FDD/prog.vb (9,35) : error VBNC90019: Expected 'End'.
/home/nt3FDD/prog.vb (10,15) : error VBNC90019: Expected 'End'.
/home/nt3FDD/prog.vb (11,17) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (13,8) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (14,12) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (15,12) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (21,16) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (22,12) : error VBNC30203: Identifier expected.
/home/nt3FDD/prog.vb (24,11) : error VBNC30203: Identifier expected.
There were 10 errors and 0 warnings.
Compilation took 00:00:00.6409320
stdout
Standard output is empty