_Core/Lang/Plugins/Parser/RecordsPlugin.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ComLib.Lang;
namespace ComLib.Lang.Extensions
{
/* *************************************************************************
<doc:example>
// Supports representing data in a table/csv like format
// 1. The top most row must the the header names without spaces
// 2. The header names must be separated by "|"
// 3. The columns in the data rows must be separated by either "|" or ","
set books1 = [
name | pages | artist
'batman' | 110 | 'john'
'xmen' | 120 | 'lee'
'daredevil' | 140 | 'maleev'
];
set books2 = [
name | pages | artist
'batman' , 110 , 'john'
'xmen' , 120 , 'lee'
'daredevil' , 140 , 'maleev'
];
</doc:example>
***************************************************************************/
/// <summary>
/// Combinator for handling swapping of variable values. swap a and b.
/// </summary>
public class RecordsPlugin : ExprPlugin
{
private static string[] _tokens = new string[] { "[" };
private Dictionary<Token, bool> _endTokens;
/// <summary>
/// Intialize.
/// </summary>
public RecordsPlugin()
{
_endTokens = new Dictionary<Token, bool>();
_endTokens[Tokens.Pipe] = true;
_endTokens[Tokens.Comma] = true;
_endTokens[Tokens.NewLine] = true;
_endTokens[Tokens.RightBracket] = true;
_hasStatementSupport = true;
_canHandleExpression = true;
_startTokens = _tokens;
}
后面还有 158 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
