Skip to content

Commit

Permalink
Misc work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
chalcolith committed Dec 6, 2024
1 parent 966fab3 commit 4ad073c
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 32 deletions.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
"environment": [],
"console": "internalConsole",
},
{
"name": "Debug Parser Perf (Windows)",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/debug/parser-perf.exe",
"args": [
"${workspaceFolder}/eohippus-vscode/test_folder/main.pony"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"console": "internalConsole",
},
{
"name": "Debug CLI (Windows)",
"type": "cppvsdbg",
Expand Down
8 changes: 4 additions & 4 deletions corral.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
],
"deps": [
{
"locator": "github.com/ponylang/appdirs.git",
"version": "0.1.5"
"locator": "github.com/chalcolith/kiuatan.git",
"version": "1.5.5"
},
{
"locator": "github.com/chalcolith/kiuatan.git",
"version": "1.5.2"
"locator": "github.com/ponylang/appdirs.git",
"version": "0.1.5"
},
{
"locator": "github.com/ponylang/logger.git",
Expand Down
32 changes: 16 additions & 16 deletions eohippus/analyzer/eohippus_analyzer.pony
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,23 @@ actor EohippusAnalyzer is Analyzer

_analyze_dir(task_id, true, workspace_path, workspace_cache, _schedule(0))

var schedule = _schedule(250)
for pony_path in _context.pony_path_dirs.values() do
try
let info = FileInfo(pony_path)?
if info.directory then
task_id = _get_next_task_id()
_analyze_dir(task_id, false, pony_path, global_cache, schedule)
end
end
end
// var schedule = _schedule(250)
// for pony_path in _context.pony_path_dirs.values() do
// try
// let info = FileInfo(pony_path)?
// if info.directory then
// task_id = _get_next_task_id()
// _analyze_dir(task_id, false, pony_path, global_cache, schedule)
// end
// end
// end

schedule = _schedule(500)
match _context.pony_packages_path
| let pony_packages_path: FilePath =>
task_id = _get_next_task_id()
_analyze_dir(task_id, false, pony_packages_path, global_cache, schedule)
end
// schedule = _schedule(500)
// match _context.pony_packages_path
// | let pony_packages_path: FilePath =>
// task_id = _get_next_task_id()
// _analyze_dir(task_id, false, pony_packages_path, global_cache, schedule)
// end

be _analyze_dir(
task_id: USize,
Expand Down
2 changes: 1 addition & 1 deletion eohippus/parser/expression_builder.pony
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ExpressionBuilder
let annotation: NamedRule = NamedRule("an annotation" where memoize' = true)
let item: NamedRule = NamedRule("an expression" where memoize' = true)
let infix: NamedRule = NamedRule("an infix expression" where memoize' = true)
let seq: NamedRule = NamedRule("an expression sequence")
let seq: NamedRule = NamedRule("an expression sequence" where memoize' = true)
let tuple_pattern: NamedRule = NamedRule("a tuple destructuring pattern")
let _method_params: NamedRule
let _typedef_members: NamedRule
Expand Down
9 changes: 6 additions & 3 deletions eohippus/parser/operator_builder.pony
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ class OperatorBuilder
let _token: TokenBuilder
let _keyword: KeywordBuilder

let prefix_op: NamedRule = NamedRule("a prefix operator")
let binary_op: NamedRule = NamedRule("a binary operator")
let postfix_op: NamedRule = NamedRule("a postfix operator")
let prefix_op: NamedRule =
NamedRule("a prefix operator" where memoize' = true)
let binary_op: NamedRule =
NamedRule("a binary operator" where memoize' = true)
let postfix_op: NamedRule =
NamedRule("a postfix operator" where memoize' = true)

new create(
trivia: TriviaBuilder,
Expand Down
2 changes: 1 addition & 1 deletion eohippus/parser/token_builder.pony
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TokenBuilder
let _trivia: TriviaBuilder

let _tokens: Map[String, NamedRule]
let identifier: NamedRule = NamedRule("an identifier")
let identifier: NamedRule = NamedRule("an identifier" where memoize' = true)

new create(context: Context, trivia: TriviaBuilder) =>
_context = context
Expand Down
4 changes: 2 additions & 2 deletions eohippus/parser/typedef_builder.pony
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class TypedefBuilder
let _type_type: TypeBuilder
let _expression: ExpressionBuilder

let doc_string: NamedRule = NamedRule("a doc string")
let doc_string: NamedRule = NamedRule("a doc string" where memoize' = true)
let method_params: NamedRule
let members: NamedRule
let field: NamedRule = NamedRule("a field")
let field: NamedRule = NamedRule("a field" where memoize' = true)
let method: NamedRule = NamedRule("a method" where memoize' = true)
let typedef: NamedRule = NamedRule("a type definition" where memoize' = true)
let typedef_primitive: NamedRule = NamedRule("a primitive type definition")
Expand Down
6 changes: 3 additions & 3 deletions eohippus/test/parser-perf/main.pony
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ actor Main
{(result: parser.Result, values: ast.NodeSeq) =>
match result
| let success: parser.Success =>
env.err.print(arg + " succeeded")
else
env.err.print(arg + " failed")
_env.out.print(arg + " succeeded")
| let failure: parser.Failure =>
_env.out.print(arg + " failed: " + failure.get_message())
end
self.print_time()
})
Expand Down
4 changes: 2 additions & 2 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param(

[Parameter(HelpMessage="The target(s) to build or test (test, fmt, lsp, cli)")]
[string]
$Target = 'test,parser-perf,fmt,lsp,cli',
$Target = 'test,perf,fmt,lsp,cli',

[Parameter(HelpMessage="The build configuration (Release, Debug).")]
[string]
Expand Down Expand Up @@ -94,7 +94,7 @@ function Build
if ($targets -like 'test') {
Run("corral.exe run -- ponyc $configFlag $ponyArgs --cpu `"$Arch`" --output `"$buildDir`" `"$rootDir\eohippus\test`"")
}
if ($targets -like 'parser-perf') {
if ($targets -like 'perf') {
Run("corral.exe run -- ponyc $configFlag $ponyArgs --cpu `"$Arch`" --output `"$buildDir`" `"$rootDir\eohippus\test\parser-perf`"")
}
if ($targets -like 'lsp') {
Expand Down

0 comments on commit 4ad073c

Please sign in to comment.