refactor: reenable tests
This commit is contained in:
parent
6965eda6a7
commit
28d48c8b2f
@ -17,7 +17,7 @@ pub fn compile_command(arguments: Vec<String>) -> Result<(), ()> {
|
||||
}
|
||||
|
||||
let argument = &arguments[0];
|
||||
if argument.starts_with("-") {
|
||||
if argument.starts_with('-') {
|
||||
let opt_str = argument.as_str();
|
||||
|
||||
println!("{}", compile_help());
|
||||
|
@ -39,10 +39,10 @@ pub fn empty_command(arguments: Vec<String>) -> Result<(), ()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn expand_option(option: &String) -> Result<EmptyOptions, String> {
|
||||
match option.as_str() {
|
||||
fn expand_option(option: &str) -> Result<EmptyOptions, String> {
|
||||
match option {
|
||||
"-h" | "--help" => Ok(EmptyOptions::Help),
|
||||
"-v" | "--version" => Ok(EmptyOptions::Version),
|
||||
_ => Err(option.clone()),
|
||||
_ => Err(option.into()),
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ use colored::*;
|
||||
pub fn help_command(arguments: Vec<String>) -> Result<(), ()> {
|
||||
println!("{}", get_help_text());
|
||||
|
||||
if arguments.len() > 0 {
|
||||
if !arguments.is_empty() {
|
||||
println!(
|
||||
"{}: {}",
|
||||
"warning".yellow(),
|
||||
|
@ -61,7 +61,7 @@ fn parse_args() -> Result<(CommandType, Vec<String>), String> {
|
||||
// Remove the first argument, which is the path to the executable
|
||||
args.remove(0);
|
||||
|
||||
let command = match args.get(0) {
|
||||
let command = match args.first() {
|
||||
Some(command) if !command.starts_with('-') => match command.as_str() {
|
||||
"c" | "compile" => CommandType::Compile,
|
||||
"f" | "format" => CommandType::Format,
|
||||
|
@ -11,21 +11,23 @@ impl Transpilable for PSimpleAssignment<'_> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
codegen::Transpilable,
|
||||
php_ast::{PExpresssion, PPrimary, PSimpleAssignment},
|
||||
};
|
||||
|
||||
/*
|
||||
#[test]
|
||||
fn should_gen_assignment() {
|
||||
let variable = String::from("name");
|
||||
let variable = &String::from("name");
|
||||
let value = String::from("John");
|
||||
let assignment = PhpPrimaryExpression::StringLiteral(&value);
|
||||
let assignment = PExpresssion::Primary(PPrimary::StringLiteral(&value));
|
||||
|
||||
let ast = PhpAssignmentExpression::SimpleAssignment(PhpSimpleAssignment {
|
||||
let ast = PSimpleAssignment {
|
||||
variable,
|
||||
assignment,
|
||||
});
|
||||
assignment: Box::new(assignment),
|
||||
};
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("$name = \"John\"", output)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -14,12 +14,12 @@ impl Transpilable for PPrimary<'_> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{codegen::Transpilable, php_ast::PPrimary};
|
||||
|
||||
/*
|
||||
#[test]
|
||||
fn should_transpile_empty_string() {
|
||||
let input = String::from("");
|
||||
let ast = PhpPrimaryExpression::StringLiteral(&input);
|
||||
let ast = PPrimary::StringLiteral(&input);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("\"\"", output)
|
||||
@ -28,7 +28,7 @@ mod tests {
|
||||
#[test]
|
||||
fn should_transpile_string() {
|
||||
let input = String::from("abc");
|
||||
let ast = PhpPrimaryExpression::StringLiteral(&input);
|
||||
let ast = PPrimary::StringLiteral(&input);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("\"abc\"", output)
|
||||
@ -37,7 +37,7 @@ mod tests {
|
||||
#[test]
|
||||
fn should_transpile_string_with_quotes() {
|
||||
let input = String::from("a\\\"b\\\"c");
|
||||
let ast = PhpPrimaryExpression::StringLiteral(&input);
|
||||
let ast = PPrimary::StringLiteral(&input);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("\"a\\\"b\\\"c\"", output)
|
||||
@ -46,7 +46,7 @@ mod tests {
|
||||
#[test]
|
||||
fn should_transpile_int() {
|
||||
let input = String::from("322");
|
||||
let ast = PhpPrimaryExpression::IntegerLiteral(&input);
|
||||
let ast = PPrimary::IntegerLiteral(&input);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("322", output)
|
||||
@ -55,7 +55,7 @@ mod tests {
|
||||
#[test]
|
||||
fn should_transpile_floating() {
|
||||
let input = String::from("322.644");
|
||||
let ast = PhpPrimaryExpression::FloatingLiteral(&input);
|
||||
let ast = PPrimary::FloatingLiteral(&input);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("322.644", output)
|
||||
@ -64,10 +64,9 @@ mod tests {
|
||||
#[test]
|
||||
fn should_transpile_variable() {
|
||||
let input = String::from("name");
|
||||
let ast = PhpPrimaryExpression::Variable(&input);
|
||||
let ast = PPrimary::Variable(&input);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("$name", output)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -10,67 +10,3 @@ impl Transpilable for PStatement<'_> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
/*
|
||||
#[test]
|
||||
fn should_gen_empty_echo_statement() {
|
||||
let expressions = PhpExpressionList {
|
||||
expressions: vec![],
|
||||
};
|
||||
let ast = PhpStatement::PhpEchoStatement(expressions);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("echo \"\";", output)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_gen_echo_with_expr() {
|
||||
let input = String::from("322");
|
||||
let exp_1 = PhpPrimaryExpression::FloatingLiteral(&input);
|
||||
let expressions = PhpExpressionList {
|
||||
expressions: vec![PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
exp_1,
|
||||
))],
|
||||
};
|
||||
let ast = PhpStatement::PhpEchoStatement(expressions);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("echo 322;", output)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_gen_echo_with_multiple_expr() {
|
||||
let input = String::from("322");
|
||||
let exp_1 = PhpPrimaryExpression::FloatingLiteral(&input);
|
||||
|
||||
let input = String::from("Hai world");
|
||||
let exp_2 = PhpPrimaryExpression::StringLiteral(&input);
|
||||
|
||||
let expressions = PhpExpressionList {
|
||||
expressions: vec![
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(exp_1)),
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(exp_2)),
|
||||
],
|
||||
};
|
||||
let ast = PhpStatement::PhpEchoStatement(expressions);
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("echo 322, \"Hai world\";", output)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_gen_expression_stmt() {
|
||||
let input = String::from("Hi!");
|
||||
let exp_1 = PhpPrimaryExpression::StringLiteral(&input);
|
||||
let ast = PhpStatement::PhpExpressionStatement(PhpExpression::Assignment(
|
||||
PhpAssignmentExpression::Primary(exp_1),
|
||||
));
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("\"Hi!\";", output)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -14,7 +14,10 @@ impl Transpilable for PFile<'_> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{codegen::Transpilable, php_ast::PFile};
|
||||
use crate::{
|
||||
codegen::Transpilable,
|
||||
php_ast::{PExpresssion, PFile, PPrimary, PStatement},
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn should_transpile_empty_file() {
|
||||
@ -24,20 +27,16 @@ mod tests {
|
||||
assert_eq!("<?php\n", output);
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
fn should_transpile_expr_statement() {
|
||||
let value = String::from("Hello world!");
|
||||
let ast = PhpAst {
|
||||
statements: vec![PhpStatement::PhpExpressionStatement(
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
PhpPrimaryExpression::StringLiteral(&value),
|
||||
)),
|
||||
)],
|
||||
let ast = PFile {
|
||||
statements: vec![PStatement::ExpressionStatement(PExpresssion::Primary(
|
||||
PPrimary::StringLiteral(&value),
|
||||
))],
|
||||
};
|
||||
let output = ast.transpile();
|
||||
|
||||
assert_eq!("<?php\n\"Hello world!\";", output);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ fn compile(input: &String) -> Result<String, String> {
|
||||
let tokens = match lexic::get_tokens(input) {
|
||||
Ok(t) => t,
|
||||
Err(error) => {
|
||||
let chars: Vec<char> = input.chars().into_iter().collect();
|
||||
let chars: Vec<char> = input.chars().collect();
|
||||
return Err(error.get_error_str(&chars));
|
||||
}
|
||||
};
|
||||
@ -78,7 +78,7 @@ fn compile(input: &String) -> Result<String, String> {
|
||||
let ast = match syntax::build_ast(&tokens) {
|
||||
Ok(ast) => ast,
|
||||
Err(reason) => {
|
||||
let chars: Vec<char> = input.chars().into_iter().collect();
|
||||
let chars: Vec<char> = input.chars().collect();
|
||||
return Err(reason.get_error_str(&chars));
|
||||
}
|
||||
};
|
||||
@ -90,7 +90,7 @@ fn compile(input: &String) -> Result<String, String> {
|
||||
match res1 {
|
||||
Ok(_) => {}
|
||||
Err(reason) => {
|
||||
let chars: Vec<char> = input.chars().into_iter().collect();
|
||||
let chars: Vec<char> = input.chars().collect();
|
||||
let error = format!("{}: {}", "error".on_red(), reason.get_error_str(&chars));
|
||||
return Err(error);
|
||||
}
|
||||
|
@ -1,56 +0,0 @@
|
||||
/// A single PHP source code file
|
||||
pub struct PFile<'a> {
|
||||
pub statements: Vec<PStatement<'a>>,
|
||||
}
|
||||
|
||||
/// A PHP statement
|
||||
pub enum PStatement<'a> {
|
||||
ExpressionStatement(PExpressionStatement<'a>),
|
||||
}
|
||||
|
||||
/// A statement composed of a single expression,
|
||||
/// whose value is discarded
|
||||
///
|
||||
/// ## Examples
|
||||
///
|
||||
/// ```php
|
||||
/// 10;
|
||||
/// "hello";
|
||||
/// ```
|
||||
pub type PExpressionStatement<'a> = PExpresssion<'a>;
|
||||
|
||||
/// A generic PHP expression
|
||||
pub enum PExpresssion<'a> {
|
||||
FunctionCall(PFunctionCall<'a>),
|
||||
Primary(PPrimary<'a>),
|
||||
/// This comes from a THP binding
|
||||
Assignment(PSimpleAssignment<'a>),
|
||||
}
|
||||
|
||||
pub struct PSimpleAssignment<'a> {
|
||||
pub variable: &'a String,
|
||||
pub assignment: Box<PExpresssion<'a>>,
|
||||
}
|
||||
|
||||
/// A function call as an expression
|
||||
pub struct PFunctionCall<'a> {
|
||||
/// Arbitrary expressions that compute into
|
||||
/// a function not supported
|
||||
pub function_name: &'a String,
|
||||
pub arguments: Vec<PExpresssion<'a>>,
|
||||
}
|
||||
|
||||
/// A Primary expression: literals and variables
|
||||
pub enum PPrimary<'a> {
|
||||
IntegerLiteral(&'a String),
|
||||
FloatingLiteral(&'a String),
|
||||
StringLiteral(&'a String),
|
||||
/// https://phplang.org/spec/19-grammar.html#grammar-variable
|
||||
///
|
||||
/// Supports only variable -> callable-variable -> simple-variable -> variable-name
|
||||
///
|
||||
/// This is a $variable
|
||||
Variable(&'a String),
|
||||
/// This is a symbol, e.g. a function name
|
||||
Symbol(&'a String),
|
||||
}
|
@ -37,15 +37,11 @@ impl<'a> PHPTransformable<'a> for Expression<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
lexic::token::Token,
|
||||
php_ast::{
|
||||
transformers::PHPTransformable, PhpAssignmentExpression, PhpExpression,
|
||||
PhpPrimaryExpression,
|
||||
},
|
||||
php_ast::{transformers::PHPTransformable, PExpresssion, PPrimary},
|
||||
syntax::ast::Expression,
|
||||
};
|
||||
|
||||
@ -56,9 +52,7 @@ mod tests {
|
||||
let output = input.into_php_ast();
|
||||
|
||||
match output {
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
PhpPrimaryExpression::StringLiteral(value),
|
||||
)) => {
|
||||
PExpresssion::Primary(PPrimary::StringLiteral(value)) => {
|
||||
assert_eq!("Hello", value)
|
||||
}
|
||||
_ => panic!("Expected a String literal"),
|
||||
@ -72,9 +66,7 @@ mod tests {
|
||||
let output = input.into_php_ast();
|
||||
|
||||
match output {
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
PhpPrimaryExpression::IntegerLiteral(value),
|
||||
)) => {
|
||||
PExpresssion::Primary(PPrimary::IntegerLiteral(value)) => {
|
||||
assert_eq!("322", value)
|
||||
}
|
||||
_ => panic!("Expected a Int literal"),
|
||||
@ -88,13 +80,10 @@ mod tests {
|
||||
let output = input.into_php_ast();
|
||||
|
||||
match output {
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
PhpPrimaryExpression::FloatingLiteral(value),
|
||||
)) => {
|
||||
PExpresssion::Primary(PPrimary::FloatingLiteral(value)) => {
|
||||
assert_eq!("322.644", value)
|
||||
}
|
||||
_ => panic!("Expected a Float literal"),
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -19,68 +19,6 @@ impl<'a> PHPTransformable<'a> for ModuleAST<'_> {
|
||||
let p_expression = expr.into_php_ast();
|
||||
|
||||
php_statements.push(PStatement::ExpressionStatement(p_expression));
|
||||
|
||||
/*
|
||||
match expr {
|
||||
Expression::FunctionCall(fc) => {
|
||||
|
||||
|
||||
|
||||
// TODO: This definitely needs refactoring
|
||||
let function_expr: &Expression = &*fc.function;
|
||||
match function_expr {
|
||||
Expression::Identifier(id) if id.value == "print" => {
|
||||
// transform to print() expression
|
||||
// no parameters supported
|
||||
|
||||
// transform parameters, expect them all to be strings
|
||||
|
||||
let mut expressions = Vec::<PhpExpression>::new();
|
||||
|
||||
for e in fc.arguments.arguments.iter() {
|
||||
match e {
|
||||
Expression::String(v) => {
|
||||
expressions.push(
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(PhpPrimaryExpression::StringLiteral(&v.value)))
|
||||
)
|
||||
},
|
||||
_ => todo!("Non string expressions not supported")
|
||||
}
|
||||
}
|
||||
|
||||
php_statements.push(Box::new(PhpStatement::PhpEchoStatement(PhpExpressionList {
|
||||
expressions
|
||||
})));
|
||||
},
|
||||
_ => todo!("Not implemented: AST transformation for function call that is not an identifier")
|
||||
}
|
||||
}
|
||||
Expression::Int(value) => {
|
||||
php_statements.push(Box::new(PhpStatement::PhpExpressionStatement(
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
PhpPrimaryExpression::IntegerLiteral(&value.value),
|
||||
)),
|
||||
)));
|
||||
}
|
||||
Expression::Float(value) => {
|
||||
php_statements.push(Box::new(PhpStatement::PhpExpressionStatement(
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
PhpPrimaryExpression::FloatingLiteral(&value.value),
|
||||
)),
|
||||
)));
|
||||
}
|
||||
Expression::String(value) => {
|
||||
php_statements.push(Box::new(PhpStatement::PhpExpressionStatement(
|
||||
PhpExpression::Assignment(PhpAssignmentExpression::Primary(
|
||||
PhpPrimaryExpression::StringLiteral(&value.value),
|
||||
)),
|
||||
)));
|
||||
}
|
||||
_ => {
|
||||
todo!("not implemented: AST transform for expression {:?}", expr)
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -91,7 +29,6 @@ impl<'a> PHPTransformable<'a> for ModuleAST<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{php_ast::transformers::PHPTransformable, syntax::ast::ModuleAST};
|
||||
@ -106,4 +43,3 @@ mod tests {
|
||||
assert!(output.statements.is_empty())
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -24,15 +24,11 @@ impl<'a> PHPTransformable<'a> for Statement<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{
|
||||
lexic::token::{Token, TokenType},
|
||||
php_ast::{
|
||||
transformers::PHPTransformable, PhpAssignmentExpression, PhpExpression,
|
||||
PhpPrimaryExpression, PhpStatement,
|
||||
},
|
||||
php_ast::{transformers::PHPTransformable, PExpresssion, PPrimary, PStatement},
|
||||
syntax::ast::{var_binding::VariableBinding, Expression, Statement},
|
||||
};
|
||||
|
||||
@ -55,13 +51,11 @@ mod tests {
|
||||
let output = binding.into_php_ast();
|
||||
|
||||
match output {
|
||||
PhpStatement::PhpExpressionStatement(PhpExpression::Assignment(
|
||||
PhpAssignmentExpression::SimpleAssignment(assignment),
|
||||
)) => {
|
||||
PStatement::ExpressionStatement(PExpresssion::Assignment(assignment)) => {
|
||||
assert_eq!("name", assignment.variable);
|
||||
|
||||
match assignment.assignment {
|
||||
PhpPrimaryExpression::StringLiteral(value) => {
|
||||
match *assignment.assignment {
|
||||
PExpresssion::Primary(PPrimary::StringLiteral(value)) => {
|
||||
assert_eq!("Hello", value);
|
||||
}
|
||||
_ => panic!("Expected a String literal as the value of the assignment"),
|
||||
@ -71,4 +65,3 @@ mod tests {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -46,7 +46,7 @@ fn compile(input: &String) {
|
||||
let tokens = match lexic::get_tokens(input) {
|
||||
Ok(t) => t,
|
||||
Err(error) => {
|
||||
let chars: Vec<char> = input.chars().into_iter().collect();
|
||||
let chars: Vec<char> = input.chars().collect();
|
||||
eprintln!("{}", error.get_error_str(&chars));
|
||||
return;
|
||||
}
|
||||
@ -58,7 +58,7 @@ fn compile(input: &String) {
|
||||
let ast = match syntax::build_ast(&tokens) {
|
||||
Ok(ast) => ast,
|
||||
Err(reason) => {
|
||||
let chars: Vec<char> = input.chars().into_iter().collect();
|
||||
let chars: Vec<char> = input.chars().collect();
|
||||
eprintln!("{}", reason.get_error_str(&chars));
|
||||
return;
|
||||
}
|
||||
@ -71,7 +71,7 @@ fn compile(input: &String) {
|
||||
match res1 {
|
||||
Ok(_) => {}
|
||||
Err(reason) => {
|
||||
let chars: Vec<char> = input.chars().into_iter().collect();
|
||||
let chars: Vec<char> = input.chars().collect();
|
||||
let error = format!("{}: {}", "error".on_red(), reason.get_error_str(&chars));
|
||||
eprintln!("{}", error);
|
||||
return;
|
||||
|
@ -9,7 +9,7 @@ use crate::{
|
||||
},
|
||||
};
|
||||
|
||||
pub fn try_parse<'a>(tokens: &'a Vec<Token>, pos: usize) -> ParsingResult<ArgumentsList> {
|
||||
pub fn try_parse(tokens: &Vec<Token>, pos: usize) -> ParsingResult<ArgumentsList> {
|
||||
let mut current_pos = pos;
|
||||
|
||||
let (opening_paren, next_pos) =
|
||||
|
@ -17,14 +17,14 @@ params list = "("
|
||||
|
||||
datatype pair = datatype, identifier;
|
||||
*/
|
||||
pub fn parse_params_list<'a>(tokens: &'a Vec<Token>, pos: usize) -> ParsingResult<ParamsList> {
|
||||
pub fn parse_params_list(tokens: &Vec<Token>, pos: usize) -> ParsingResult<ParamsList> {
|
||||
let mut current_pos = pos;
|
||||
|
||||
let (opening_paren, next_pos) =
|
||||
match parse_token_type(tokens, current_pos, TokenType::LeftParen) {
|
||||
Ok((t, next)) => (t, next),
|
||||
Err(ParsingError::Err(err)) => return Err(ParsingError::Err(err)),
|
||||
Err(ParsingError::Mismatch(t)) => return Err(ParsingError::Mismatch(&t)),
|
||||
Err(ParsingError::Mismatch(t)) => return Err(ParsingError::Mismatch(t)),
|
||||
Err(ParsingError::Unmatched) => return Err(ParsingError::Unmatched),
|
||||
};
|
||||
current_pos = next_pos;
|
||||
@ -91,7 +91,7 @@ pub fn parse_params_list<'a>(tokens: &'a Vec<Token>, pos: usize) -> ParsingResul
|
||||
/// - `Type identifier = default_value`
|
||||
/// - `FunctionType identifier`
|
||||
/// - `Pattern identifier` (e.g. `Some[String] value`)?
|
||||
fn parse_param_definition<'a>(tokens: &'a Vec<Token>, pos: usize) -> ParsingResult<Parameter> {
|
||||
fn parse_param_definition(tokens: &Vec<Token>, pos: usize) -> ParsingResult<Parameter> {
|
||||
let mut current_pos = pos;
|
||||
let (datatype, next_pos) =
|
||||
match utils::parse_token_type(tokens, current_pos, TokenType::Datatype) {
|
||||
|
@ -12,8 +12,6 @@ impl<'a> Parseable<'a> for VariableBinding<'a> {
|
||||
type Item = VariableBinding<'a>;
|
||||
|
||||
fn try_parse(tokens: &'a Vec<Token>, current_pos: usize) -> ParsingResult<'a, Self::Item> {
|
||||
let current_pos = current_pos;
|
||||
|
||||
/*
|
||||
* val/var keyword
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user